diff options
| author | Tim Rühsen <tim.ruehsen@gmx.de> | 2017-08-01 11:15:10 +0200 |
|---|---|---|
| committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2017-08-01 11:15:10 +0200 |
| commit | 16853b6973a1e72fee2b7cccda85472cb9951305 (patch) | |
| tree | c4bf019e603f475463bd946fe8907baef42fac75 | |
| parent | 7669214302ed2308b1142e39a070b7ff7f358a5a (diff) | |
| download | libidn2-16853b6973a1e72fee2b7cccda85472cb9951305.tar.gz | |
lib/bidi: Fix integer overflow (found by fuzzing)
| -rw-r--r-- | lib/bidi.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -30,6 +30,7 @@ #include "idn2.h" +#include <sys/types.h> #include <stdbool.h> #include "bidi.h" @@ -39,7 +40,7 @@ static bool _isBidi (const uint32_t *label, size_t llen) { - while (llen-- > 0) { + for (; (ssize_t) llen > 0; llen--) { int bc = uc_bidi_category (*label++); if (bc == UC_BIDI_R || bc == UC_BIDI_AL || bc == UC_BIDI_AN) |
