aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_string_sprintf.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2007-07-15 19:13:59 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2007-07-15 19:13:59 +0000
commitd3bb69751364bfe5fe7ad915646d5b327df9cb8b (patch)
tree277b7c303ff4bb3a5583547383d51d714527e1c8 /lib/libarchive/archive_string_sprintf.c
parent75d0856ca5bd3d33a6a3627d58bd1a3fd73b3a0c (diff)
Notes
Diffstat (limited to 'lib/libarchive/archive_string_sprintf.c')
-rw-r--r--lib/libarchive/archive_string_sprintf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libarchive/archive_string_sprintf.c b/lib/libarchive/archive_string_sprintf.c
index 66d6cb85e7f0..4401e9a12773 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;