Skip to content

Commit

Permalink
fix single stack-use-after-scope found by AddressSanitizer
Browse files Browse the repository at this point in the history
libcob/common.c (cob_cmp): fix stack-use-after-scope for comparisons of unsigned numeric with non-numeric field
  • Loading branch information
sf-mensch committed Jan 4, 2023
1 parent ca129c7 commit 617c03b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libcob/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

2023-01-04 Simon Sobisch <[email protected]>

* common.c (cob_cmp): fix stack-use-after-scope for comparisons of unsigned
numeric with non-numeric field

2023-01-03 Simon Sobisch <[email protected]>

* common.c (cob_accept_date, cob_accept_date_yyyymmdd, cob_accept_day,
Expand Down
4 changes: 4 additions & 0 deletions libcob/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3868,7 +3868,11 @@ cob_cmp (cob_field *f1, cob_field *f2)
return cob_cmp_alnum (f1, f2);
}
}
/* done here to have the data for non-signed numeric vs. non-numeric in scope */
return cob_cmp_alnum (f1, f2);
}

/* both data not numeric: compare as string */
return cob_cmp_alnum (f1, f2);
}

Expand Down

0 comments on commit 617c03b

Please sign in to comment.