summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-05-21 17:03:17 +0300
committerDenys Fedoryshchenko <denys.f@collabora.com>2026-05-21 17:03:17 +0300
commit22c61e8e2e16ebe8e9576fe46487e3614982e8ac (patch)
tree73f23e95ffc8e53058f7eec9a36e82cbfaa8d8f9
parent1b67ba0785a847eee6adb69b7e68995c33803805 (diff)
downloadaccel-ppp-22c61e8e2e16ebe8e9576fe46487e3614982e8ac.tar.gz
accel-ppp-22c61e8e2e16ebe8e9576fe46487e3614982e8ac.zip
fix: dict.c: split() could return 0, making dict_load read ptr[-1]
If a RADIUS dictionary contains a line consisting of exactly one word with no trailing spaces (for example, standard keywords like "END-VENDOR\n" or "END-TLV\n" ), this bug getting triggered. Triggering crash is compiler dependent, it might not happen now, but a bit different compiler, flags, and it might crash on load. Reported-by: Khedor <khedor@gmail.com> Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
-rw-r--r--accel-pppd/radius/dict.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/accel-pppd/radius/dict.c b/accel-pppd/radius/dict.c
index 145c5da2..c181c7cd 100644
--- a/accel-pppd/radius/dict.c
+++ b/accel-pppd/radius/dict.c
@@ -92,7 +92,7 @@ static int dict_load(const char *fname)
continue;
r = split(buf, ptr);
- if (*ptr[r - 1] == '#')
+ if (r > 0 && *ptr[r - 1] == '#')
r--;
if (!strcmp(buf, "VENDOR")) {