Last Comment Bug 390554 - all PKIX_NULLCHECK_ errors are reported as "PKIX ALLOC ERROR"
: all PKIX_NULLCHECK_ errors are reported as "PKIX ALLOC ERROR"
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: trunk
: All All
P1 normal (vote)
: 3.12
Assigned To: Alexei Volkov
Depends on:
  Show dependency treegraph
Reported: 2007-08-01 16:18 PDT by Alexei Volkov
Modified: 2007-11-08 15:50 PST (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---


Description User image Alexei Volkov 2007-08-01 16:18:24 PDT
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".
Comment 1 User image Nelson Bolyard (seldom reads bugmail) 2007-08-01 19:12:32 PDT
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.
Comment 2 User image Nelson Bolyard (seldom reads bugmail) 2007-08-01 19:22:30 PDT
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),

So, where/how does PKIX_NULLARGUMENT get turned into PKIX_ALLOC_ERROR ??
Comment 3 User image Nelson Bolyard (seldom reads bugmail) 2007-08-01 19:45:10 PDT
Steve, DO you know how PKIX_NULLARGUMENT gets turned into PKIX_ALLOC_ERROR ?
Comment 4 User image Steve Parkinson 2007-08-02 10:20:48 PDT
I'm afraid I don't.
Comment 5 User image Nelson Bolyard (seldom reads bugmail) 2007-08-02 10:49:19 PDT
If someone can give me a reproducible test case for this (may need a test 
program) I am willing to dig into it.
Comment 6 User image Nelson Bolyard (seldom reads bugmail) 2007-09-27 16:52:52 PDT
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; \

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.
Comment 7 User image Alexei Volkov 2007-11-08 15:50:22 PST
Fixed by patch to bug 391457

Note You need to log in before you can comment on or make changes to this bug.