OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-3545-g8f51502

Gerrit Code Review gerrit@openafs.org
Thu, 28 Feb 2013 16:17:49 -0800 (PST)


The following commit has been merged in the master branch:
commit 8f51502e5f45a43fba130d260813716be894d51e
Author: Simon Wilkinson <sxw@your-file-system.com>
Date:   Thu Feb 28 12:15:29 2013 +0000

    dumptool: Remove newlines safely
    
    The code currently does
    
       fgets(cmdbuf, ... );
       cmdbuf[strlen(cmdbuf - 1)] = '\0';
    
    in order to remove new lines from cmdbuf. Coverity thinks there's
    a danger of strlen(cmdbuf) being 0, and thus the strlen being negative.
    That shouldn't happen, but if fgets hits EOF midway through a line, we
    might get a string that doesn't have a trailing '\n', and end up
    removing the wrong character. Tidy this up by checking that the string
    isn't 0 length, and that the character we're zapping is a newline.
    
    Caught by coverity (#985430)
    
    Change-Id: I8dae925debdc2473a6a51db021ce843e957a1557
    Reviewed-on: http://gerrit.openafs.org/9310
    Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

 src/tools/dumpscan/dumptool.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

-- 
OpenAFS Master Repository