Skip to content

Commit 793d7c0

Browse files
authored
fix potential null pointer dereference found by coverity (#187)
CID 442478: (#undefined of undefined): Explicit null dereferenced (FORWARD_NULL) 6. var_deref_model: Passing null pointer app to SQLWriteFileDSN, which dereferences it.[show details] 119 ret = SQLWriteFileDSN( file, app, key, str );
1 parent 5fe9f74 commit 793d7c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

odbcinst/SQLWriteFileDSN.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ BOOL INSTAPI SQLWriteFileDSNW(LPCWSTR lpszFileName,
116116
key = lpszKeyName ? _single_string_alloc_and_copy( lpszKeyName ) : (char*)NULL;
117117
str = lpszString ? _single_string_alloc_and_copy( lpszString ) : (char*)NULL;
118118

119-
ret = SQLWriteFileDSN( file, app, key, str );
119+
ret = app ? SQLWriteFileDSN( file, app, key, str ) : FALSE;
120120

121121
if ( file )
122122
free( file );

0 commit comments

Comments
 (0)