Skip to content

Commit

Permalink
Additional test to avoid address under/overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Nov 12, 2018
1 parent 4f0066d commit 821ed57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dcm2niix/nii_dicom_batch.cpp
Expand Up @@ -1794,7 +1794,7 @@ int nii_createFilename(struct TDICOMdata dcm, char * niiFilename, struct TDCMopt
strcat (baseoutname,pth);
char appendChar[2] = {"a"};
appendChar[0] = kPathSeparator;
if ((pth[strlen(pth)-1] != kPathSeparator) && (outname[0] != kPathSeparator))
if ((strlen(pth) > 0) && (pth[strlen(pth)-1] != kPathSeparator) && (outname[0] != kPathSeparator))
strcat (baseoutname,appendChar);
//Allow user to specify new folders, e.g. "-f dir/%p" or "-f %s/%p/%m"
// These folders are created if they do not exist
Expand Down

0 comments on commit 821ed57

Please sign in to comment.