Bugzilla bug #39967: replace an assertion in _PR_MD_GETFILEINFO64 by NSPRPUB_CLIENT_BRANCH
authorwtc%netscape.com
Fri, 26 May 2000 19:51:27 +0000
branchNSPRPUB_CLIENT_BRANCH
changeset 1387 c03039feab1ad895ed303b9c61620e07fa011e20
parent 1368 e34ed156a1f33f887360ca25426cb93163029229
child 1388 5fc49d95b8e16a6ddf330b1d24f28897cd4f10bc
child 1413 0430cdf724bd6e7133969783093d3054295dd644
push idunknown
push userunknown
push dateunknown
bugs39967
Bugzilla bug #39967: replace an assertion in _PR_MD_GETFILEINFO64 by proper error checking and failure return. Thanks to Bernd Mielke <mielke@licel.com> for the bug report. Modified files: ntio.c, w95io.c (NSPRPUB_CLIENT_BRANCH. r=larryh@netscape.com. nsbeta2+)
pr/src/md/windows/ntio.c
pr/src/md/windows/w95io.c
--- a/pr/src/md/windows/ntio.c
+++ b/pr/src/md/windows/ntio.c
@@ -3011,17 +3011,20 @@ PRInt32
          * a root directory or a pathname that ends in a slash.
          */
         if (NULL == _mbspbrk(fn, ".\\/")) {
             _PR_MD_MAP_OPENDIR_ERROR(GetLastError());
             return -1;
         } 
         len = GetFullPathName(fn, sizeof(pathbuf), pathbuf,
                 &filePart);
-        PR_ASSERT(0 != len);
+        if (0 == len) {
+            _PR_MD_MAP_OPENDIR_ERROR(GetLastError());
+            return -1;
+        }
         if (len > sizeof(pathbuf)) {
             PR_SetError(PR_NAME_TOO_LONG_ERROR, 0);
             return -1;
         }
         if (IsRootDirectory(pathbuf, sizeof(pathbuf))) {
             info->type = PR_FILE_DIRECTORY;
             info->size = 0;
             /*
--- a/pr/src/md/windows/w95io.c
+++ b/pr/src/md/windows/w95io.c
@@ -768,17 +768,20 @@ PRInt32
          * a root directory or a pathname that ends in a slash.
          */
         if (NULL == _mbspbrk(fn, ".\\/")) {
             _PR_MD_MAP_OPENDIR_ERROR(GetLastError());
             return -1;
         } 
         len = GetFullPathName(fn, sizeof(pathbuf), pathbuf,
                 &filePart);
-        PR_ASSERT(0 != len);
+        if (0 == len) {
+            _PR_MD_MAP_OPENDIR_ERROR(GetLastError());
+            return -1;
+        }
         if (len > sizeof(pathbuf)) {
             PR_SetError(PR_NAME_TOO_LONG_ERROR, 0);
             return -1;
         }
         if (IsRootDirectory(pathbuf, sizeof(pathbuf))) {
             info->type = PR_FILE_DIRECTORY;
             info->size = 0;
             /*