Please sign in to comment.
Patch for zero length malloc and check for malloc success
There is a feasible code path such that the string will have a length of zero. Malloc of a zero length has a implementation dependent result (i.e. possible invalid memory pointer). Add one to the requested length to eliminate the abiguity. In addition, check the return from malloc to insure it was successful. (cherry picked from commit 28a77c3) Signed-off-by: Stuart Morgan <email@example.com> Fixes #11570
- Loading branch information...
Showing with 6 additions and 1 deletion.