strings.c: Improve numeric detection in ast_strings_match().

Essentially, we were treating 1234x1234 and 1234x5678 as 'equal'
because we were able to convert the prefix of each of these strings to
the same number.

Resolves: #1028
(cherry picked from commit dafac1f6f4)
This commit is contained in:
Sean Bright
2025-01-15 11:42:29 -05:00
committed by Asterisk Development Team
parent 2b428734fd
commit 8b736f2047
2 changed files with 18 additions and 1 deletions

View File

@@ -717,6 +717,9 @@ AST_TEST_DEFINE(strings_match)
ast_test_validate(test, !ast_strings_match(NULL, NULL, "abc"));
ast_test_validate(test, !ast_strings_match(NULL, NULL, NULL));
/* See https://github.com/asterisk/asterisk/issues/1028 */
ast_test_validate(test, !ast_strings_match("123456789c1", NULL, "123456789c2"));
return AST_TEST_PASS;
}