Skip to content
Snippets Groups Projects
Unverified Commit 6c15aea8 authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #2134 from ihsinme/develop

fix of possible memory overflow. 
parents fd8f700a fdc510f7
Branches
Tags
No related merge requests found
......@@ -288,9 +288,9 @@ uint8_t TskRecover::writeFile(TSK_FS_FILE * a_fs_file, const char *a_path)
}
if (fbuf[strlen(fbuf) - 1] != '/')
strncat(fbuf, "/", PATH_MAX - strlen(fbuf));
strncat(fbuf, "/", PATH_MAX - strlen(fbuf)-1);
strncat(fbuf, a_fs_file->name->name, PATH_MAX - strlen(fbuf));
strncat(fbuf, a_fs_file->name->name, PATH_MAX - strlen(fbuf)-1);
//do name mangling of the file name that was just added
for (int i = strlen(fbuf)-1; fbuf[i] != '/'; i--) {
......
......@@ -801,7 +801,7 @@ tsk_fs_dir_walk_lcl(TSK_FS_INFO * a_fs, DENT_DINFO * a_dinfo,
strncpy(a_dinfo->didx[a_dinfo->depth],
fs_file->name->name,
DIR_STRSZ - strlen(a_dinfo->dirs));
strncat(a_dinfo->dirs, "/", DIR_STRSZ);
strncat(a_dinfo->dirs, "/", DIR_STRSZ-1);
depth_added = 1;
a_dinfo->depth++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment