From 72055a29115f7cd3d5bea70ca249c0b44daa2b9e Mon Sep 17 00:00:00 2001 From: duncan-mcewan <64446406+duncan-mcewan@users.noreply.github.com> Date: Wed, 29 Apr 2020 07:47:18 +1200 Subject: [PATCH] Fix incorrect pointer increment When encountering a backslash character the memmove() call removes it. But then the pointer p should only be incremented by 1 to skip the escaped character rather than 2, which also skips the character following the escaped one. --- lib/sl/sl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sl/sl.c b/lib/sl/sl.c index f6f4bc52e..03f577b5f 100644 --- a/lib/sl/sl.c +++ b/lib/sl/sl.c @@ -248,7 +248,7 @@ sl_make_argv(char *line, int *ret_argc, char ***ret_argv) if (p[1] == '\0') goto failed; memmove(&p[0], &p[1], strlen(&p[1]) + 1); - p += 2; + p += 1; continue; } else if (quote || !isspace((unsigned char)*p)) { p++;