From: Michael Tremer Date: Wed, 4 Oct 2023 16:02:21 +0000 (+0000) Subject: parser: scanner: Abort if we could not allocate memory X-Git-Tag: 0.9.30~1554 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f863a8e3cb1549575dadea29fdcf2d9a8ad9b9d5;p=pakfire.git parser: scanner: Abort if we could not allocate memory Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/parser/scanner.l b/src/libpakfire/parser/scanner.l index 6bf90a21e..e6659cc41 100644 --- a/src/libpakfire/parser/scanner.l +++ b/src/libpakfire/parser/scanner.l @@ -88,6 +88,8 @@ static char* copy_string(const char* s) { // Allocate a working buffer char* buffer = malloc(l + 1); + if (!buffer) + return NULL; // Copy input string to buffer memcpy(buffer, s, l + 1);