[ovs-git] Open vSwitch: lib/util: Input validation in str_to_uint (master)

dev at openvswitch.org dev at openvswitch.org
Wed Apr 23 19:03:49 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  4c21aa063fa1c7f95800c95fafebedcd577ce674 (commit)
      from  34799871bf18ce7d6124e137dcca31ef88af9156 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4c21aa063fa1c7f95800c95fafebedcd577ce674
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=4c21aa063fa1c7f95800c95fafebedcd577ce674
Author: Zoltan Kiss <zoltan.kiss at citrix.com>
		
lib/util: Input validation in str_to_uint
		
This function returns true when 's' is negative or greater than UINT_MAX. Also,
the representation of 'int' and 'unsigned int' is implementation dependent, so
converting [INT_MAX..UINT_MAX] values with str_to_int is fragile.
Instead, we should convert straight to 'long long' and do a boundary check
before returning the converted value.
This patch also move the function to the .c file as it's not-trivial now, and
deletes the other str_to_u* functions as they are not used.

Signed-off-by: Zoltan Kiss <zoltan.kiss at citrix.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 lib/util.c |   14 ++++++++++++++
 lib/util.h |   19 +------------------
 2 files changed, 15 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list