]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
!whitespace is also "not zero and not whitespace"
authorAlan T. DeKok <aland@freeradius.org>
Wed, 2 Oct 2019 02:12:59 +0000 (22:12 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 2 Oct 2019 02:12:59 +0000 (22:12 -0400)
When parsing zero-terminated strings, stop at zero.

src/lib/util/misc.h

index dbe7cc7a5af96a15411aab8e4250d4ba4ed81329..985fb8ee223b0b363e14974aadaf975ef23be773 100644 (file)
@@ -72,7 +72,7 @@ void          fr_talloc_verify_cb(const void *ptr, int depth,
  *
  * @param[in,out] _p   string to skip over.
  */
-#define fr_skip_not_whitespace(_p) while(!isspace((int)*(_p))) _p++
+#define fr_skip_not_whitespace(_p) while(*_p && !isspace((int)*(_p))) _p++
 
 /** Zero out any whitespace with nul bytes
  *