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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-08-28 23:14:57 +00:00
parent 45453100e9
commit 4fb3ae9ecf
3 changed files with 7 additions and 5 deletions

View File

@@ -213,6 +213,8 @@ static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
AST_APP_ARG(options);
);
buf[0] = '\0';/* Ensure the buffer is initialized. */
if (!chan) {
return -1;
}