mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user