mbox series

[v3,0/3] Add handling of abnormal input for parse_opts()

Message ID 20221205065432.242539-1-zhaogongyi@huawei.com
Headers show
Series Add handling of abnormal input for parse_opts() | expand

Message

Zhao Gongyi Dec. 5, 2022, 6:54 a.m. UTC
Changes in v3:
  1. Modify the checking of SAFE_STRTOF as suggested by Cyril
  2. Adjust the position of the checking of the return value for
     SAFE_STRTOUL

Changes in v2:
  1. Add range checking for SAFE_STRTOF as suggested by Cyril

Changes in v1:
  1. Add SAFE_STRTOF
  2. Replace atoi/atof with SAFE_STRTOL/SAFE_STRTOF to deal with abnormal
     input for parse_opts()

Zhao Gongyi (3):
  lib/safe_macros: Add SAFE_STRTOF
  lib: Replace atoi/atof with SAFE_STRTOL/SAFE_STRTOF
  lib: Adjust the position of the checking of the return value

 include/safe_macros_fn.h  |  3 +++
 include/tst_safe_macros.h |  3 +++
 lib/safe_macros.c         | 33 +++++++++++++++++++++++++++++++++
 lib/tst_test.c            |  9 ++++-----
 4 files changed, 43 insertions(+), 5 deletions(-)

--
2.17.1

Comments

Cyril Hrubis Dec. 7, 2022, 3:40 p.m. UTC | #1
Hi!
Patchset pushed, thanks.