callocMustSucceed suspends thread if 0 bytes are requested
Bug #541320 reported by
Dirk Zimoch
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
High
|
Andrew Johnson |
Bug Description
The release notes say:
"mallocMustSucceed and callocMustSucceed accept 0-byte requests. Note that these routines may return a NULL pointer in such cases."
But the code does this:
if (count == 0 || size == 0)
This crashes applications that assumes it is safe to allocate 0 bytes. I noticed that when I tried to start an "empty" IOC (no records defined).
Fix is simple:
if (count == 0 || size == 0) return NULL;
Original Mantis Bug: mantis-290
http://
To post a comment you must log in.
I forgot to say that the bug is new in 3.14.9.