git: hexdump: always stat input when skipping

Sascha Wildner swildner at crater.dragonflybsd.org
Mon Aug 10 06:51:05 PDT 2009


commit a030f2fad7ca7b90cf61d2be5ba16149a2c13f9c
Author: Sascha Wildner <saw at 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





More information about the Commits mailing list