all PKIX_NULLCHECK_ errors are reported as "PKIX ALLOC ERROR"

RESOLVED FIXED in 3.12

Status

NSS
Libraries
P1
normal
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Alexei Volkov, Assigned: Alexei Volkov)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: PKIX)

(Assignee)

Description

10 years ago
Many pkix function have input arguments check. The check is done by PKIX_NULLCHECK_{ONE,TWO,THREE,FOUR} macros. If NULL check fails, then
libpkix misleadingly reports such error as "PKIX ALLOC ERROR".
(Assignee)

Updated

10 years ago
Priority: -- → P3
Whiteboard: PKIX
I think this is P2, if not P1.  This will cause us no end of headache.
People will get these errors and report that NSS is leaking memory, etc.
Priority: P3 → P2
The PKIX_NULLCHECK_{ONE,TWO,THREE,FOUR} macros all set the error code
PKIX_NULLARGUMENT, for which the error string is "Null argument".

include/pkix_errorstrings.h:693:PKIX_ERRORENTRY(NULLARGUMENT,Null argument),
The "PKIX ALLOC ERROR" string is for PKIX_ALLOC_ERROR.  See
http://lxr.mozilla.org/security/source/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c#52

So, where/how does PKIX_NULLARGUMENT get turned into PKIX_ALLOC_ERROR ??
Steve, DO you know how PKIX_NULLARGUMENT gets turned into PKIX_ALLOC_ERROR ?
Summary: libpkix reports all errors that caused by failure of PKIX_NULLCHECK_ macro as "PKIX ALLOC ERROR" → all PKIX_NULLCHECK_ errors are reported as "PKIX ALLOC ERROR"

Comment 4

10 years ago
I'm afraid I don't.
If someone can give me a reproducible test case for this (may need a test 
program) I am willing to dig into it.
Version: 3.12 → trunk
(Assignee)

Updated

10 years ago
Priority: P2 → P1
In a patch for another bug, Alexei included a one line patch for THIS bug.
It was:

Index: lib/libpkix/pkix/util/pkix_tools.h
 
 #define PKIX_ERROR_FATAL(descNum) \
     { \
 	pkixErrorReceived = PKIX_TRUE; \
 	pkixErrorMsg = PKIX_ErrorText[descNum]; \
+	pkixErrorCode = descNum; \
 	_PKIX_LOG_ERROR(pkixErrorMsg, PKIX_LOGGER_LEVEL_FATALERROR); \
 	PKIX_RETURN(FATAL); \
     }

I give r+ to the above tiny patch here.  That patch should be checked in 
by itself, separately from the patch for that other bug, with a comment 
pointing out that it is the fix for this bug.
(Assignee)

Comment 7

10 years ago
Fixed by patch to bug 391457
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.