Skip to content
Snippets Groups Projects
Commit 063d4700 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Address Coverty reported issue about dereferencing a NULL pointer

CID 345291
It's actually a false positive because if an extension (".suffix") exists in filespec, it must also exist in newfilespec since it's a copy, but whatever. It's better form to check.
parent 55962a41
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2573 passed
......@@ -195,11 +195,12 @@ file_t* loadfiles(smb_t* smb, const char* filespec, time_t t, enum file_detail d
size_t len = strlen(filespec);
if(len >= 12 && strcspn(filespec, "*?") == len) {
SAFECOPY(newfilespec, filespec);
char* ext = getfext(newfilespec);
if(ext != NULL) {
*ext = 0;
char* ext = getfext(filespec);
char* newext = getfext(newfilespec);
if(ext != NULL && newext != NULL) {
*newext = 0;
SAFECAT(newfilespec, "*");
SAFECAT(newfilespec, getfext(filespec));
SAFECAT(newfilespec, ext);
} else
SAFECAT(newfilespec, "*");
filespec = newfilespec;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment