DragonFly commits List (threaded) for 2009-08
DragonFly BSD
DragonFly commits List (threaded) for 2009-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: hexdump: always stat input when skipping


From: Sascha Wildner <swildner@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Aug 2009 06:49:54 -0700 (PDT)

commit a030f2fad7ca7b90cf61d2be5ba16149a2c13f9c
Author: Sascha Wildner <saw@online.de>
Date:   Mon Aug 10 10:30:20 2009 +0200

    hexdump: always stat input when skipping
    
    The previous code would not fstat(2) the input, if operating on stdin.
    Still, it would use the uninitialized struct stat to decide whether to
    seek in the input or not.  This could either lead to hexdump reading the
    skipped input, instead of directly seeking, or, worse, trying a seek
    even though this not being possible.
    
    Fix this issue by always fstat()ing the input.
    
    Submitted-by: corecode

Summary of changes:
 usr.bin/hexdump/display.c |   24 +++++++++---------------
 usr.bin/hexdump/hexdump.h |    2 +-
 2 files changed, 10 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a030f2fad7ca7b90cf61d2be5ba16149a2c13f9c


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]