Skip to content

Commit

Permalink
fix potential null pointer dereference found by coverity (#189)
Browse files Browse the repository at this point in the history
CID 442531: (#undefined of undefined): Explicit null dereferenced (FORWARD_NULL)
35. var_deref_model: Passing null pointer szPWD to OpenDatabase, which dereferences it.[show details]

CID 442534: (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
36. var_deref_model: Passing null pointer szUID to OpenDatabase, which dereferences it.[show details]

211    if ( !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ) )
  • Loading branch information
chipitsine authored Oct 7, 2024
1 parent 9a34643 commit 9c30b88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exe/isql.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int main( int argc, char *argv[] )
* CONNECT
***************************/

if ( !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ) )
if (szPWD==NULL || szUID==NULL || !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ))
exit( 1 );

/****************************
Expand Down

0 comments on commit 9c30b88

Please sign in to comment.