From: Derrick Brashear Date: Thu, 3 Oct 2002 22:24:08 +0000 (+0000) Subject: fileserver-may-not-have-valid-diskDataHandle-if-volume-was-offlined-20021003 X-Git-Tag: openafs-devel-1_3_50~583 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c6da165252c61a2328837d13c4463026d47a45c0;p=packages%2Fo%2Fopenafs.git fileserver-may-not-have-valid-diskDataHandle-if-volume-was-offlined-20021003 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 --- diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index 78defc299..cfd761476 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -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? */ diff --git a/src/vol/volume.c b/src/vol/volume.c index 4394ffd5c..77b823672 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -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;