]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Lib: Fix mem_hash_mix_str() infinite loop/OOB read
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Tue, 10 Feb 2026 00:16:51 +0000 (01:16 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 10 Feb 2026 00:16:51 +0000 (01:16 +0100)
lib/hash.h

index 3c173958ff8146b006c748ddc9715ea4a59d7ea4..41409e47e3146b74e1bfdfe2ecf61ed4da1639af 100644 (file)
@@ -219,7 +219,7 @@ static inline void
 mem_hash_mix_str(u64 *h, const char *s)
 {
   const u64 multiplier = 0xb38bc09a61202731ULL;
-  while (s)
+  while (*s)
     *h = *h * multiplier + *s++;
 }