Skip to content

Commit 9c30b88

Browse files
authored
fix potential null pointer dereference found by coverity (#189)
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 ) )
1 parent 9a34643 commit 9c30b88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exe/isql.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ int main( int argc, char *argv[] )
208208
* CONNECT
209209
***************************/
210210

211-
if ( !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ) )
211+
if (szPWD==NULL || szUID==NULL || !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ))
212212
exit( 1 );
213213

214214
/****************************

0 commit comments

Comments
 (0)