Project

General

Profile

Actions

Bug #3053

closed

Replace atoi with StringParse* for better error handling

Added by Philippe Antoine about 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
High
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

See https://wiki.sei.cmu.edu/confluence/display/c/ERR34-C.+Detect+errors+when+converting+a+string+to+a+number

And grepping atom gives results such as
src//detect-modbus.c: modbus->address->min = atoi((const char*) (arg+1));


Related issues 1 (0 open1 closed)

Related to Suricata - Bug #2080: Rules with bad port group var do not errorClosedPhilippe AntoineActions
Actions #1

Updated by Philippe Antoine about 5 years ago

  • Related to Bug #2080: Rules with bad port group var do not error added
Actions #2

Updated by Victor Julien about 5 years ago

I think we should use a wrapper to keep code compact. We might be able to use/reuse the wrappers in util-byte.c

Actions #3

Updated by Andreas Herz about 5 years ago

  • Assignee set to OISF Dev
  • Target version set to TBD
Actions #4

Updated by Victor Julien about 5 years ago

https://github.com/OISF/suricata/pull/4019

Keeping the ticket open as there are more places we'd like to see this fixed.

Actions #5

Updated by Victor Julien about 5 years ago

  • Subject changed from Replace atoi with strtol for better error handling to Replace atoi with ByteExtractString* for better error handling
  • Priority changed from Normal to High
  • Target version changed from TBD to 5.0rc1
Actions #6

Updated by Shivani Bhardwaj almost 5 years ago

  • Status changed from New to Assigned
  • Assignee changed from OISF Dev to Shivani Bhardwaj
Actions #7

Updated by Shivani Bhardwaj almost 5 years ago

  • Status changed from Assigned to Feedback
Actions #8

Updated by Shivani Bhardwaj almost 5 years ago

  • Status changed from Feedback to Assigned
Actions #9

Updated by Victor Julien almost 5 years ago

  • Target version changed from 5.0rc1 to 6.0.0beta1
Actions #10

Updated by Shivani Bhardwaj over 4 years ago

  • Subject changed from Replace atoi with ByteExtractString* for better error handling to Replace atoi with StringParse* for better error handling
Actions #11

Updated by Victor Julien over 4 years ago

  • Status changed from Assigned to In Review
Actions

Also available in: Atom PDF