mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
main/strings: Fix uninitialized value.
ast_strings_match uses sscanf and checks for non-zero return to verify a token was parsed. This is incorrect as sscanf returns EOF (-1) for errors. ASTERISK-27318 #close Change-Id: Ifcece92605f58116eff24c5a0a3b0ee08b3c87b1
This commit is contained in:
@@ -314,7 +314,7 @@ regex:
|
||||
}
|
||||
|
||||
equals:
|
||||
scan_numeric = (sscanf(left, "%lf", &left_num) && sscanf(internal_right, "%lf", &right_num));
|
||||
scan_numeric = (sscanf(left, "%lf", &left_num) > 0 && sscanf(internal_right, "%lf", &right_num) > 0);
|
||||
|
||||
if (internal_op[0] == '=') {
|
||||
if (ast_strlen_zero(left) && ast_strlen_zero(internal_right)) {
|
||||
|
Reference in New Issue
Block a user