mirror of
https://github.com/topjohnwu/selinux.git
synced 2024-12-03 09:00:51 +00:00
bc0a0327ca
If any of the build flags `BUILD_HOST` or `ANDROID` is set and the caller did not pass an option of type `SELABEL_OPT_PATH`, the variable `path` might be not set. Add a check to avoid calling `strdup()` with a NULL pointer. Found by cppcheck. src/label_file.c:759:26: warning: Possible null pointer dereference: path [nullPointer] rec->spec_file = strdup(path); ^ src/label_file.c:713:21: note: Assignment 'path=NULL', assigned value is 0 const char *path = NULL; ^ src/label_file.c:759:26: note: Null pointer dereference rec->spec_file = strdup(path); ^ Signed-off-by: Christian Göttsche <cgzones@googlemail.com> |
||
---|---|---|
.. | ||
include | ||
man | ||
src | ||
utils | ||
LICENSE | ||
Makefile | ||
VERSION |