]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
also avoid potential null deref in ih_open but with the ReadVolumeHeader patch
authorDerrick Brashear <shadow@dementia.org>
Thu, 14 Nov 2002 20:41:44 +0000 (20:41 +0000)
committerGarry Zacheiss <zacheiss@mit.edu>
Thu, 14 Nov 2002 20:41:44 +0000 (20:41 +0000)
we should never get there.

thanks to Kris Van Hees for discovering this

(cherry picked from commit c6da165252c61a2328837d13c4463026d47a45c0)

src/vol/ihandle.c
src/vol/volume.c

index ca5a54808490b9c64a1414a8180dac7cc9825715..e8f8c15aba091032375106da79661479e00c1f82 100644 (file)
@@ -257,6 +257,9 @@ FdHandle_t *ih_open(IHandle_t *ihP)
     FD_t fd;
     FD_t closeFd;
 
+    if (!ihP) /* XXX should log here in the fileserver */
+       return NULL;
+
     IH_LOCK
 
     /* Do we already have an open file handle for this Inode? */
index c2afa3e4e86fe2a333488a4f900612eec925698b..889d9eac95aad1c735e8a5f0f90b549c12273e2d 100644 (file)
@@ -388,6 +388,11 @@ static void ReadHeader(Error *ec, IHandle_t *h, char *to, int size,
     FdHandle_t *fdP;
 
     *ec = 0;
+    if (h == NULL) {
+       *ec = VSALVAGE;
+       return;
+    }
+
     fdP = IH_OPEN(h);
     if (fdP == NULL) {
        *ec = VSALVAGE;