From: Arran Cudbard-Bell Date: Sun, 24 May 2020 15:02:42 +0000 (-0500) Subject: value: Limit null arguments in value box from str X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2da48cf492129403d30c59676d392cc86bbfcee1;p=thirdparty%2Ffreeradius-server.git value: Limit null arguments in value box from str --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 6c9e09f9298..3c8d0883c2a 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -4125,8 +4125,6 @@ int fr_value_box_from_str(TALLOC_CTX *ctx, fr_value_box_t *dst, if (!fr_cond_assert(*dst_type != FR_TYPE_INVALID)) return -1; - if (!in) return -1; - len = (inlen < 0) ? strlen(in) : (size_t)inlen; /* diff --git a/src/lib/util/value.h b/src/lib/util/value.h index 03ff79bed4c..f353421a159 100644 --- a/src/lib/util/value.h +++ b/src/lib/util/value.h @@ -642,7 +642,8 @@ void fr_value_box_increment(fr_value_box_t *vb); */ int fr_value_box_from_str(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t *dst_type, fr_dict_attr_t const *dst_enumv, - char const *src, ssize_t src_len, char quote, bool tainted); + char const *src, ssize_t src_len, char quote, bool tainted) + CC_HINT(nonnull(2,3,5)); /* * Lists