commit | 67d3cb55873f1721246da50cf3a56325eed1856e | [log] [download] |
---|---|---|
author | Kir Kolyshkin <kir@openvz.org> | Fri Apr 05 16:30:16 2013 -0700 |
committer | Kir Kolyshkin <kir@openvz.org> | Fri Apr 05 16:44:33 2013 -0700 |
tree | 71de0e12b222b9968a8a12e12127a82e8225c00a | |
parent | b03aa3c001005c312f11b8c0b429684d2dd4ec7f [diff] |
remove_names(): fix potenial null pointer dereference The code to strip the path from the 'content' is incorrect, since in case '/' is not found p becomes null. One way to fix it would be to add else p = content; Instead, let's just use the GNU version of basename which does exactly what we want. Note this patch relies on _GNU_SOURCE to be defined during compilation, and string.h to be included. Found by coverity, CID 996855. Signed-off-by: Kir Kolyshkin <kir@openvz.org>