Closed Bug 195731 Opened 17 years ago Closed 16 years ago

Compiler warning in security/manager/ssl/src/nsPKCS12Blob.cpp

Categories

(Core Graveyard :: Security: UI, defect, major)

1.0 Branch
defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 194240

People

(Reporter: tenthumbs, Assigned: ssaux)

Details

Gcc says 

  nsPKCS12Blob.cpp:538: warning: \
   comparison of unsigned expression < 0 is always false

The code is

     529   PRUint32 amount;
     ...
     538     if (amount < 0) {
     539       fileStream.close();
     540       return NS_ERROR_FAILURE;
     541     }

so the error block is unreachable and gcc eliminates it.
Over to something like the right product....
Assignee: mstoltz → ssaux
Severity: normal → major
Component: Security: General → Client Library
Product: Browser → PSM
QA Contact: carosendahl → junruh
Version: Trunk → 2.4
Blocks: buildwarning
Fix included in bug 194240 attachment 117024 [details] [diff] [review]
{
   while (PR_TRUE) {
-    amount = fileStream.read(buf, PIP_PKCS12_BUFFER_SIZE);
-    if (amount < 0) {
-      fileStream.close();
-      return NS_ERROR_FAILURE;
+    rv = fileStream->Read(buf, PIP_PKCS12_BUFFER_SIZE, &amount);
+    if (NS_FAILED(rv)) {
+      return rv;
     }
}
which was v1.36.

*** This bug has been marked as a duplicate of 194240 ***
No longer blocks: buildwarning
Status: NEW → RESOLVED
Closed: 16 years ago
OS: Linux → All
Hardware: PC → All
Resolution: --- → DUPLICATE
Product: PSM → Core
Version: psm2.4 → 1.0 Branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.