Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
legacy-0.0-26compat-2.6.6
-
None
Description
Read a date which is defined as ISODate("0001-01-01T00:00:00Z") from mongodb into a Date_t, then calling toTimeT() crashes, probably because time_t cannot represent dates before 1970 and the conversion doesn't check this.
No exception thrown neither - try/catch block could not handle the case.
(gdb) bt
#0 0x00007f92545b35db in raise () from /lib64/libpthread.so.0
#1 0x00000000006b2c47 in mongo::mongo_breakpoint() ()
#2 0x00000000006aca17 in mongo::verifyFailed(char const*, char const*, unsigned int) ()
#3 0x00000000006bedf4 in mongo::Date_t::toTimeT() const ()