]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check length of extend_lowat
authorAlan T. DeKok <aland@freeradius.org>
Fri, 26 Dec 2025 16:00:21 +0000 (11:00 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 26 Dec 2025 16:18:31 +0000 (11:18 -0500)
src/lib/util/sbuff.h

index ed6def0746f3e5441c9e0270701b483786f9b1d7..7ce46ff349a21ecf7bfccc8e47036e97febb513f 100644 (file)
@@ -1769,7 +1769,7 @@ static inline bool fr_sbuff_is_in_charset(fr_sbuff_t *sbuff, bool const chars[st
 static inline bool fr_sbuff_is_str(fr_sbuff_t *sbuff, char const *str, size_t len)
 {
        if (len == SIZE_MAX) len = strlen(str);
-       if (!fr_sbuff_extend_lowat(NULL, sbuff, len)) return false;
+       if (fr_sbuff_extend_lowat(NULL, sbuff, len) < len) return false;
        return memcmp(sbuff->p, str, len) == 0;
 }
 #define fr_sbuff_is_str_literal(_sbuff, _str) fr_sbuff_is_str(_sbuff, _str, sizeof(_str) - 1)