git: sbin/hammer: check strtol()/strtoll() results to avoid irrelevant history queries

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Wed Feb 18 11:19:42 PST 2015


commit 8f10d7e0b43182923754be9e737ca80112fb1cb8
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Thu Feb 19 02:07:03 2015 +0900

    sbin/hammer: check strtol()/strtoll() results to avoid irrelevant history
    queries
    
    - Check errno for possible overflow/underflow by strtol()/strtoll() in
      order to avoid ioctl with irrelevant offset/length.
    
    - Examples
      # hammer -vvv history at 11111111111111111111111111111111,111 ./out
      Result too large: @11111111111111111111111111111111
      # hammer -vvv history at 111,11111111111111111111111111111111 ./out
      Result too large: ,11111111111111111111111111111111
      # hammer -vvv history at -11111111111111111111111111111111,111 ./out
      Result too large: @-11111111111111111111111111111111
      # hammer -vvv history at 111,-11111111111111111111111111111111 ./out
      Result too large: ,-11111111111111111111111111111111

Summary of changes:
 sbin/hammer/cmd_history.c | 38 ++++++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8f10d7e0b43182923754be9e737ca80112fb1cb8


-- 
DragonFly BSD source repository



More information about the Commits mailing list