Project

General

Profile

Actions

Bug #3053

closed
PA SB

Replace atoi with StringParse* for better error handling

Bug #3053: Replace atoi with StringParse* for better error handling

Added by Philippe Antoine almost 7 years ago. Updated over 5 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

PA Updated by Philippe Antoine almost 7 years ago Actions #1

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

VJ Updated by Victor Julien almost 7 years ago Actions #2

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

AH Updated by Andreas Herz almost 7 years ago Actions #3

  • Assignee set to OISF Dev
  • Target version set to TBD

VJ Updated by Victor Julien over 6 years ago Actions #4

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

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

VJ Updated by Victor Julien over 6 years ago Actions #5

  • 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

SB Updated by Shivani Bhardwaj over 6 years ago Actions #6

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

SB Updated by Shivani Bhardwaj over 6 years ago Actions #7

  • Status changed from Assigned to Feedback

SB Updated by Shivani Bhardwaj over 6 years ago Actions #8

  • Status changed from Feedback to Assigned

VJ Updated by Victor Julien over 6 years ago Actions #9

  • Target version changed from 5.0rc1 to 6.0.0beta1

SB Updated by Shivani Bhardwaj over 6 years ago Actions #10

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

VJ Updated by Victor Julien about 6 years ago Actions #11

  • Status changed from Assigned to In Review
Actions

Also available in: PDF Atom