Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
parser: fix parsing of large integers on i686 systems.
Browse files Browse the repository at this point in the history
Our integer packets are set in int32_t for size, but parsing them
involved an intermediary strtol(), which could overflow on our inputs on
32 bit systems. By moving to strtoll() we stay safe on both 64/32-bit
systems.

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
  • Loading branch information
Gustavo Lima Chaves committed Oct 20, 2015
1 parent e05849f commit bba21b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/flow/sol-flow-node-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ get_member_memory(const struct sol_flow_node_options_member_description *member,
return (uint8_t *)opts + member->offset;
}

#define STRTOL_DECIMAL(_ptr, _endptr) strtol(_ptr, _endptr, 0)
#define STRTOL_DECIMAL(_ptr, _endptr) strtoll(_ptr, _endptr, 0)

#define ASSIGN_LINEAR_VALUES(_parse_func, \
_max_val, _max_str, _max_str_len, \
Expand Down

0 comments on commit bba21b5

Please sign in to comment.