diff options
Diffstat (limited to 'lib/libarchive/archive_string_sprintf.c')
-rw-r--r-- | lib/libarchive/archive_string_sprintf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libarchive/archive_string_sprintf.c b/lib/libarchive/archive_string_sprintf.c index 66d6cb85..4401e9a 100644 --- a/lib/libarchive/archive_string_sprintf.c +++ b/lib/libarchive/archive_string_sprintf.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include "archive_string.h" +#include "archive_private.h" /* * Like 'vsprintf', but ensures the target is big enough, resizing if @@ -56,7 +57,8 @@ __archive_string_vsprintf(struct archive_string *as, const char *fmt, uintmax_t u; /* Unsigned integer temp. */ const char *p, *p2; - __archive_string_ensure(as, 64); + if (__archive_string_ensure(as, 64) == NULL) + __archive_errx(1, "Out of memory"); if (fmt == NULL) { as->s[0] = 0; |