Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: patches/07_fix_strcpy_in_ptp_unpack_ptptime.patch

Issue 2364793002: Revert "Uprev libmtp to 1.1.12" (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libmtp@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « patches/04_parse_extension_descriptor_null_check.patch ('k') | patches/08_add_licenses.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Index: src/ptp-pack.c
2 ===================================================================
3 --- src/ptp-pack.c (revision 148712)
4 +++ src/ptp-pack.c (working copy)
5 @@ -533,7 +533,7 @@
6 ptp_unpack_PTPTIME (const char *str) {
7 char ptpdate[40];
8 char tmp[5];
9 - int ptpdatelen;
10 + size_t ptpdatelen;
11 struct tm tm;
12
13 if (!str)
14 @@ -543,11 +543,12 @@
15 /*ptp_debug (params ,"datelen is larger then size of buffer", pt pdatelen, (int)sizeof(ptpdate));*/
16 return 0;
17 }
18 - strcpy (ptpdate, str);
19 if (ptpdatelen<15) {
20 /*ptp_debug (params ,"datelen is less than 15 (%d)", ptpdatelen) ;*/
21 return 0;
22 }
23 + strncpy (ptpdate, str, sizeof(ptpdate));
24 + ptpdate[sizeof(ptpdate) - 1] = '\0';
25
26 memset(&tm,0,sizeof(tm));
27 strncpy (tmp, ptpdate, 4);
OLDNEW
« no previous file with comments | « patches/04_parse_extension_descriptor_null_check.patch ('k') | patches/08_add_licenses.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698