From: Todd C. Miller Date: Fri, 14 Nov 2014 23:31:56 +0000 (-0700) Subject: Fix potential NULL pointer deref found by cppcheck. X-Git-Tag: SUDO_1_8_12^2~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3870fdf622af99be62cd10ae3d130db21d690f91;p=sudo Fix potential NULL pointer deref found by cppcheck. --- diff --git a/plugins/sudoers/iolog_path.c b/plugins/sudoers/iolog_path.c index 4fac617ed..1356b0b4a 100644 --- a/plugins/sudoers/iolog_path.c +++ b/plugins/sudoers/iolog_path.c @@ -275,9 +275,10 @@ expand_iolog_path(const char *prefix, const char *dir, const char *file, *dst = '\0'; } } - if (slashp) + if (slash != NULL) + *slash = '/'; + if (slashp != NULL) *slashp = slash; - *slash = '/'; debug_return_str(path); bad: