Message ID | 20250220220758.GT21808@frogsfrogsfrogs (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | xfs_scrub: fix buffer overflow in string_escape | expand |
diff --git a/scrub/common.c b/scrub/common.c index 6eb3c026dc5ac9..7ea0277bc511ce 100644 --- a/scrub/common.c +++ b/scrub/common.c @@ -320,7 +320,7 @@ string_escape( char *q; int x; - str = malloc(strlen(in) * 4); + str = malloc((strlen(in) * 4) + 1); if (!str) return NULL; for (p = in, q = str; *p != '\0'; p++) {