* g3.c: fixed buffer overflow by incorrect strcpy()s

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8000 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2005-05-14 12:58:15 +00:00
parent 76870b7fb6
commit 66ee42e6e3

View File

@@ -766,9 +766,9 @@ file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
char xfn[13];
int date, time, month, year;
strcpy(xfn, buf+n*32);
strncpy (xfn, buf+n*32, 8);
xfn[8] = '.';
strcpy(xfn+9, buf+n*32+8);
strncpy (xfn+9, buf+n*32+8, 3);
xfn[8+1+3] = '\0';
ret = gp_filesystem_append (fs, folder, xfn, context);