mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-03 04:16:43 +00:00
Use ast_copy_string instead of strncpy to guarantee a NUL terminated string.
........ Merged revisions 374132 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374133 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -332,7 +332,7 @@ int ast_db_get(const char *family, const char *key, char *value, int valuelen)
|
||||
ast_log(LOG_WARNING, "Couldn't get value\n");
|
||||
res = -1;
|
||||
} else {
|
||||
strncpy(value, (const char *) result, valuelen);
|
||||
ast_copy_string(value, (const char *) result, valuelen);
|
||||
}
|
||||
sqlite3_reset(get_stmt);
|
||||
ast_mutex_unlock(&dblock);
|
||||
|
||||
Reference in New Issue
Block a user