From 1b67ba0785a847eee6adb69b7e68995c33803805 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Thu, 21 May 2026 15:50:42 +0300 Subject: strip: Fix invalid parsing strip() memmove count was one short, dropping the NULL terminator; dpado_parse error path leaked already-parsed range entries. Also affects ipoe. Since strip is identical in both, we can place fixed common function in utils. Reported-by: Khedor Signed-off-by: Denys Fedoryshchenko --- accel-pppd/utils.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'accel-pppd/utils.c') diff --git a/accel-pppd/utils.c b/accel-pppd/utils.c index 018b6efa..f92ebe19 100644 --- a/accel-pppd/utils.c +++ b/accel-pppd/utils.c @@ -347,3 +347,14 @@ int __export u_randbuf(void *buf, size_t buf_len, int *err) return 0; } + +void __export u_strstrip(char *str, char c) +{ + char *src = str, *dst = str; + while (*src) { + if (*src != c) + *dst++ = *src; + src++; + } + *dst = '\0'; +} -- cgit v1.2.3