mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Re-eliminated the use of strcpy() in pngtest.c. An unncessary use
of strcpy() was accidentally re-introduced in libpng16; this change replaces it with strncpy().
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
0a9f8eb272
commit
5f5977e708
10
pngtest.c
10
pngtest.c
@@ -1050,7 +1050,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
tIME_string[png_sizeof(tIME_string) - 1] = '\0';
|
||||
|
||||
else
|
||||
strcpy(tIME_string, "*** invalid time ***");
|
||||
{
|
||||
strncpy(tIME_string, "*** invalid time ***", sizeof tIME_string);
|
||||
tIME_string[(sizeof tIME_string)-1] = '\0';
|
||||
}
|
||||
|
||||
tIME_chunk_present++;
|
||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */
|
||||
@@ -1256,7 +1259,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
tIME_string[png_sizeof(tIME_string) - 1] = '\0';
|
||||
|
||||
else
|
||||
strcpy(tIME_string, "*** invalid time ***");
|
||||
{
|
||||
strncpy(tIME_string, "*** invalid time ***", sizeof tIME_string);
|
||||
tIME_string[(sizeof tIME_string)-1] = '\0';
|
||||
}
|
||||
|
||||
tIME_chunk_present++;
|
||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */
|
||||
|
||||
Reference in New Issue
Block a user