If filespec1 is NULL, it doesn't matter what dso is, it will not pass the first 
if, so the latter checks for dso and filespec1 are useless.
 
==================================

Eugen Sendroiu
Address: str. Horia nr 3,
bl a8, sc 2, ap 7, Craiova
Dolj - 200490, Romania
Home : +40(0)351 401134
Mobile : +40(0)743 055244
         +40(0)730 006760
E-mail : [EMAIL PROTECTED]
         [EMAIL PROTECTED]


===================================

----- Original Message ----
From: Michael Saladin <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, April 9, 2008 9:06:14 AM
Subject: RE: Interesting logic in dso_lib.c (libcrypto)

   _filtered {
font-family:Calibri;}
 _filtered {margin:1.0in 1.0in 1.0in 1.0in;}
P.MsoNormal {
FONT-SIZE:12pt;MARGIN:0in 0in 0pt;FONT-FAMILY:"Times New Roman", "serif";}
LI.MsoNormal {
FONT-SIZE:12pt;MARGIN:0in 0in 0pt;FONT-FAMILY:"Times New Roman", "serif";}
DIV.MsoNormal {
FONT-SIZE:12pt;MARGIN:0in 0in 0pt;FONT-FAMILY:"Times New Roman", "serif";}
A:link {
COLOR:blue;TEXT-DECORATION:underline;}
SPAN.MsoHyperlink {
COLOR:blue;TEXT-DECORATION:underline;}
A:visited {
COLOR:purple;TEXT-DECORATION:underline;}
SPAN.MsoHyperlinkFollowed {
COLOR:purple;TEXT-DECORATION:underline;}
PRE {
FONT-SIZE:10pt;MARGIN:0in 0in 0pt;FONT-FAMILY:"Courier New";}
SPAN.EmailStyle17 {
COLOR:#1f497d;FONT-FAMILY:"Calibri", "sans-serif";}
SPAN.HTMLPreformattedChar {
FONT-FAMILY:"Courier New";}
SPAN.eventline {
}
SPAN.linenumerr {
}
.MsoChpDefault {
}
DIV.Section1 {
}
The first 'if' just guarantees that dso OR filespec1 are 
not NULL, each of those parameters could be NULL 
individually.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
Salivar.William
Sent: Mittwoch, 9. April 2008 00:04
To: [email protected]
Subject: Interesting logic in dso_lib.c (libcrypto)



The 
first ‘if’ guarantees that filespec1 will not be NULL.  And yet there are 
two tests for NULL in the code following the ‘if’.  This is from OpenSSL 
0.9.8g.
   
   
 393    char *DSO_merge(DSO *dso, const char *filespec1, const char 
*filespec2)394            {395            char *result = NULL;396     Event 
cannot_single: After this line (or expression), the value of "filespec1" cannot 
be 0397            if(dso == NULL || filespec1 == NULL)398                    
{399                    DSOerr(DSO_F_DSO_MERGE,ERR_R_PASSED_NULL_PARAMETER);400 
                   return(NULL);401                    }Event 
dead_error_condition: On this path, the condition "filespec1 == 0" could not be 
true402            if(filespec1 == NULL)Event dead_error_line: Cannot reach 
this line of code, beginning "dso"403                    filespec1 = 
dso->filename;404            if(filespec1 == NULL)405                    {406   
                 DSOerr(DSO_F_DSO_MERGE,DSO_R_NO_FILE_SPECIFICATION);407        
            return(NULL);408                    }409            if((dso->flags 
& DSO_FLAG_NO_NAME_TRANSLATION) == 0)410                   
 {411                    if(dso->merger != NULL)412                            
result = dso->merger(dso, filespec1, filespec2);413                    else 
if(dso->meth->dso_merger != NULL)414                            result = 
dso->meth->dso_merger(dso,415                                   filespec1, 
filespec2);416                    }417            return(result);418            
}   








__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to