1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-05-13 23:23:51 +00:00

vasnprintf: fix potential use after free

* lib/vasnprintf.c (VASNPRINTF): Fix free-memory read,
flagged by clang-analyzer 3.4.2.
This commit is contained in:
Pádraig Brady
2014-12-06 01:14:02 +00:00
parent 79002fdd9f
commit c5c4f53b31
2 changed files with 7 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2014-12-06 Pádraig Brady <P@draigBrady.com>
vasnprintf: fix potential use after free
* lib/vasnprintf.c (VASNPRINTF): Fix free-memory read,
flagged by clang-analyzer 3.4.2.
2014-12-05 Pádraig Brady <P@draigBrady.com>
filevercmp, posixtm: avoid compiler warnings with -O3

View File

@@ -5184,13 +5184,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
free (result);
if (buf_malloced != NULL)
free (buf_malloced);
CLEANUP ();
errno =
(saved_errno != 0
? saved_errno
: (dp->conversion == 'c' || dp->conversion == 's'
? EILSEQ
: EINVAL));
CLEANUP ();
return NULL;
}