diff options
author | Corey Farrell <git@cfware.com> | 2017-10-05 21:23:31 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-10-05 21:23:31 -0400 |
commit | 0f3e725503a84ce9b39120b5f74f1e504d18a98a (patch) | |
tree | debd94c788059ebb39ff6c7a800802669ec8fda8 /main/strings.c | |
parent | 3ef6834c3b6fb9cb73164dcc56a10820026a63c5 (diff) |
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
Diffstat (limited to 'main/strings.c')
-rw-r--r-- | main/strings.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/strings.c b/main/strings.c index 3207fa15e..82e315aea 100644 --- a/main/strings.c +++ b/main/strings.c @@ -312,7 +312,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)) { |