diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-07-15 09:47:18 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-07-15 09:47:18 +0200 |
commit | eac2a2cc668f491c7d265c5fe6c50f51a60c6256 (patch) | |
tree | 87a5f5c9f173123465a6d7ad42a493b070f71348 /src/format.c | |
parent | 1842e4ff88f93490966398ae9b763f6dba069799 (diff) | |
parent | 163bc6d7fc268bdb1c7cc03699f69d0c5cc0b4cd (diff) |
Update upstream source from tag 'upstream/4.14'
Update to upstream version '4.14'
with Debian dir 714f602a4a45e9e83780cc1f0ad69803d12fe0e6
Diffstat (limited to 'src/format.c')
-rw-r--r-- | src/format.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/format.c b/src/format.c index 25c09d6..e924c6a 100644 --- a/src/format.c +++ b/src/format.c @@ -7,6 +7,7 @@ * General Public License as published by the Free Software Foundation; * either version 2.1 or (at your option) any later version. */ +#include <assert.h> #include <errno.h> #include <stdbool.h> #include <stddef.h> @@ -681,6 +682,7 @@ EXPORT_SYMBOL ssize_t HXformat3_aprintf(const struct HXformat_map *blk, out: ret = -errno; HXmc_free(out); + *resultp = nullptr; return ret; } @@ -716,7 +718,7 @@ EXPORT_SYMBOL int HXformat_sprintf(const struct HXformat_map *ftable, EXPORT_SYMBOL ssize_t HXformat3_sprintf(const struct HXformat_map *ftable, char *dest, size_t size, const char *fmt) { - hxmc_t *str; + hxmc_t *str = nullptr; ssize_t ret; if ((ret = HXformat_aprintf(ftable, &str, fmt)) < 0) @@ -725,6 +727,7 @@ EXPORT_SYMBOL ssize_t HXformat3_sprintf(const struct HXformat_map *ftable, *dest = '\0'; return 0; } + assert(str != nullptr); strncpy(dest, str, size); size_t xl = strlen(dest); HXmc_free(str); |