Browse Source

Fix stack buffer overflow in remove_whitespace()

Signed-off-by: vikk777 <listratenko1998@mail.ru>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
vikk777 10 months ago
parent
commit
6cc3a242e1
1 changed files with 3 additions and 0 deletions
  1. 3 0
      exec/coroparse.c

+ 3 - 0
exec/coroparse.c

@@ -271,6 +271,9 @@ static char *remove_whitespace(char *string, int remove_colon_and_brace)
 	char *end;
 
 	start = string;
+	if (*start == '\0')
+		return start;
+
 	while (*start == ' ' || *start == '\t' || (unsigned char)*start == 0xA0)
 		start++;