From: Hiltjo Posthuma Date: Wed, 5 May 2021 23:04:35 +0000 (+0200) Subject: fix an out-of-bounds read if the input is "" X-Git-Url: https://git.armaanb.net/?p=sic.git;a=commitdiff_plain;h=df4c0611366bf361fa263fbc57009cbe68456855 fix an out-of-bounds read if the input is "" Notified by Guilherme Janczak , thanks! --- diff --git a/util.c b/util.c index bdba718..2567812 100644 --- a/util.c +++ b/util.c @@ -61,7 +61,7 @@ trim(char *s) { char *e; e = s + strlen(s) - 1; - while(isspace(*e) && e > s) + while(e > s && isspace(*e)) e--; *(e + 1) = '\0'; }