Skip to content

Commit

Permalink
fix potential null pointer deref found by coverity (#190)
Browse files Browse the repository at this point in the history
CID 442541: (#2 of 2): Explicit null dereferenced (FORWARD_NULL)
7. var_deref_model: Passing null pointer buf to SQLGetPrivateProfileString, which dereferences it. [Note: The source code implementation of the function has been overridden by a builtin model.]
      CID 442541:(#1 of 2):Explicit null dereferenced (FORWARD_NULL) [ "select issue" ]
645        ret = SQLGetPrivateProfileString( sect, entry, def, buf, cbRetBuffer, name );
  • Loading branch information
chipitsine authored Oct 7, 2024
1 parent d20dd0e commit 9a34643
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odbcinst/SQLGetPrivateProfileString.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ int INSTAPI SQLGetPrivateProfileStringW( LPCWSTR lpszSection,
buf = NULL;
}

ret = SQLGetPrivateProfileString( sect, entry, def, buf, cbRetBuffer, name );
ret = buf ? SQLGetPrivateProfileString( sect, entry, def, buf, cbRetBuffer, name ) : -1;

if ( sect )
free( sect );
Expand Down

0 comments on commit 9a34643

Please sign in to comment.