diff --git a/c/src/ChangeLog b/c/src/ChangeLog index b84dc2c76a..a625561259 100644 --- a/c/src/ChangeLog +++ b/c/src/ChangeLog @@ -1,3 +1,9 @@ +2008-04-25 Till Straumann + + * nfsclient/Changelog.slac, nfsclient/src/nfs.c: + BUGFIX (PR#1284) -- possible memory corruption if + server connectivity is lost. + 2007-09-25 Joel Sherrill * nfsclient/Makefile.am: Fix errors. diff --git a/c/src/nfsclient/ChangeLog.slac b/c/src/nfsclient/ChangeLog.slac index 94dea06763..dab9705bbe 100644 --- a/c/src/nfsclient/ChangeLog.slac +++ b/c/src/nfsclient/ChangeLog.slac @@ -1,3 +1,11 @@ +Changes since RTEMS-NFS 1.5: + - BUGFIX: path lookup ('evalpath') would erroneously return 0 (success) if + 1. server had been alive in the past + 2. server connectivity is lost + the bug, if triggered, caused memory + corruption. + (fixes PR#1284) + Changes since RTEMS-NFS 1.4: LICENSE: - changed license terms; RTEMS-NFS is now released under the more liberal diff --git a/c/src/nfsclient/src/nfs.c b/c/src/nfsclient/src/nfs.c index 2b5a04e36f..2ff879a070 100644 --- a/c/src/nfsclient/src/nfs.c +++ b/c/src/nfsclient/src/nfs.c @@ -929,6 +929,7 @@ NfsNode rval = nfsNodeCreate(node->nfs, 0); if (node->str) { rval->args.name = rval->str = strdup(node->str); if (!rval->str) { + errno = ENOMEM; nfsNodeDestroy(rval); return 0; } @@ -1393,6 +1394,11 @@ unsigned long niu,siu; /* clone the node */ if ( !node ) { /* nodeClone sets errno */ + pathloc->node_access = 0; + if ( ! (e = errno) ) { + /* if we have no node, e must not be zero! */ + e = ENOMEM; + } goto cleanup; }