From bf82fcd2162423e7c17da9bc66fb390d0cb2ed74 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Sun, 6 Apr 2025 20:24:22 +0200 Subject: Make all pointers mandatory (not NULL) --- src/misc.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/misc.h b/src/misc.h index e52b93bd..7327846d 100644 --- a/src/misc.h +++ b/src/misc.h @@ -33,13 +33,14 @@ static inline void a_Misc_parse_content_disposition(const char *disposition, cha const char terminators[] = " ;\t"; const char *str, *s; - if (type) - *type = NULL; - if (filename) - *filename = NULL; - if (!(str = disposition)) + /* All are mandatory */ + if (!disposition || !type || !filename) return; + *type = NULL; + *filename = NULL; + str = disposition; + for (s = str; *s && d_isascii((uchar_t)*s) && !iscntrl((uchar_t)*s) && !strchr(tspecials_space, *s); s++) ; if (type && !(s == str)) -- cgit v1.2.3