]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
volser/vol_split.c: do not dereference known-NULL pointer
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Sun, 6 Jan 2013 04:44:33 +0000 (23:44 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Sun, 6 Jan 2013 05:40:17 +0000 (21:40 -0800)
Avoid dereferencing a pointer that we just checked is NULL when printing
an error message.

Change-Id: Ibc89883977e7044cab2a844d97b7f0f7d236f4ea
Reviewed-on: http://gerrit.openafs.org/8878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/volser/vol_split.c

index c6f31c3a140c0f8f9d97bcee657cf0dbe6e705b2..5b39496cbda24a053be01066a8e239d705986f8e 100644 (file)
@@ -239,9 +239,9 @@ copyDir(struct Msg *m, IHandle_t *inh, IHandle_t *outh)
     infdP = IH_OPEN(inh);
     if (!infdP) {
        sprintf(m->line, "Couldn't open input directory %" AFS_VOLID_FMT ".%u.%u\n",
-               afs_printable_VolumeId_lu(infdP->fd_ih->ih_vid),
-               (afs_uint32)(infdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
-               (afs_uint32)(infdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
+               afs_printable_VolumeId_lu(inh->ih_vid),
+               (afs_uint32)(inh->ih_ino & NAMEI_VNODEMASK),
+               (afs_uint32)(inh->ih_ino >> NAMEI_UNIQSHIFT));
        rx_Write(m->call, m->line, strlen(m->line));
        return EIO;
     }
@@ -257,9 +257,9 @@ copyDir(struct Msg *m, IHandle_t *inh, IHandle_t *outh)
     outfdP = IH_OPEN(outh);
     if (!outfdP) {
        sprintf(m->line, "Couldn't open output directory %" AFS_VOLID_FMT ".%u.%u\n",
-               afs_printable_VolumeId_lu(outfdP->fd_ih->ih_vid),
-               (afs_uint32)(outfdP->fd_ih->ih_ino & NAMEI_VNODEMASK),
-               (afs_uint32)(outfdP->fd_ih->ih_ino >> NAMEI_UNIQSHIFT));
+               afs_printable_VolumeId_lu(outh->ih_vid),
+               (afs_uint32)(outh->ih_ino & NAMEI_VNODEMASK),
+               (afs_uint32)(outh->ih_ino >> NAMEI_UNIQSHIFT));
        rx_Write(m->call, m->line, strlen(m->line));
        FDH_REALLYCLOSE(infdP);
        return EIO;