diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-08-28 23:15:43 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-08-28 23:15:43 +0000 |
commit | 186db8fdaf415f838c6c0bc29c9bd821ad3146c7 (patch) | |
tree | 18d28030be38688e1208e005082aebb843090cba /main/stdtime | |
parent | 94e4733d89e9616f27888d0a88efc135318ecab4 (diff) |
Fix some uninitialized buffers for CDR handling valgrind found.
* Made ast_strftime_locale() ensure that the output buffer is initialized.
The std library strftime() returns 0 and does not touch the buffer if it
has an error. However, the function can also return 0 without an error.
(closes issue ASTERISK-22412)
Reported by: rmudgett
........
Merged revisions 397902 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/stdtime')
-rw-r--r-- | main/stdtime/localtime.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c index f7b4bd005..5ca43b818 100644 --- a/main/stdtime/localtime.c +++ b/main/stdtime/localtime.c @@ -2304,6 +2304,7 @@ int ast_strftime_locale(char *buf, size_t len, const char *tmp, const struct ast long fraction; const char *prevlocale; + buf[0] = '\0';/* Ensure the buffer is initialized. */ if (!format) { return -1; } |