]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
fileserver-may-not-have-valid-diskDataHandle-if-volume-was-offlined-20021003
authorDerrick Brashear <shadow@dementia.org>
Thu, 3 Oct 2002 22:24:08 +0000 (22:24 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 3 Oct 2002 22:24:08 +0000 (22:24 +0000)
also avoid potential null deref in ih_open but with the ReadVolumeHeader patch
we should never get there.

thanks to Kris Van Hees for discovering this

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

index 78defc29966758b16c27f0d7619249e8ccb47e03..cfd7614765d8a03bf9f3204add28abe63f0e5ed2 100644 (file)
@@ -264,6 +264,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 4394ffd5c779f27e498b75063dce5f605289324a..77b82367247b31d73e0a9dc4782ea71c37efa291 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;