From: Baptiste Daroussin Date: Tue, 20 Jun 2023 07:59:12 +0000 (+0200) Subject: xstring: prevent null pointer dereference X-Git-Tag: RELEASE_1_4_0rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8d74d81e295dbe6bc53939a5172c48e7e4f6c1c;p=thirdparty%2Fmlmmj.git xstring: prevent null pointer dereference --- diff --git a/include/xstring.h b/include/xstring.h index 24738a66..8c348ad2 100644 --- a/include/xstring.h +++ b/include/xstring.h @@ -59,6 +59,8 @@ do { \ static inline char * xstring_get(xstring *str) { + if (str == NULL) + return (NULL); fclose(str->fp); char *ret = str->buf; free(str);