mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
res_pjsip_authenticator_digest: Fix md5 hash buffer
An md5 hash is 32 bytes long. The char buffer must be at least 33 bytes to avoid clobbering of the stack. This patch also fixes a potential clobbering in test_utils.c. Thanks to Andrew Nagy for reporting and testing this out in #asterisk-dev Reported by: Andrew Nagy Tested by: Andrew Nagy git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@404843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -202,7 +202,7 @@ AST_TEST_DEFINE(md5_test)
|
||||
ast_test_status_update(test, "Testing MD5 ...\n");
|
||||
|
||||
for (i = 0; i < ARRAY_LEN(tests); i++) {
|
||||
char md5_hash[32];
|
||||
char md5_hash[33];
|
||||
ast_md5_hash(md5_hash, tests[i].input);
|
||||
if (strcasecmp(md5_hash, tests[i].expected_output)) {
|
||||
ast_test_status_update(test,
|
||||
|
Reference in New Issue
Block a user