Browse code

core: parse content - group operation to avoid overflow

Daniel-Constantin Mierla authored on 14/09/2021 06:03:47
Showing 1 changed files
... ...
@@ -237,7 +237,7 @@ char* parse_content_length(char* const buffer, const char* const end,
237 237
 			LM_ERR("content lenght value is too large\n");
238 238
 			goto error;
239 239
 		}
240
-		number = number*10 + (*p)-'0';
240
+		number = number*10 + ((*p) - '0');
241 241
 		size ++;
242 242
 		p++;
243 243
 	}