From d9aa331ce4c234d2bf902d0e7b7a096fab46727c Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 4 Jul 2015 09:15:24 +1000 Subject: [PATCH] grabbag: Replace strncpy with safe_strncpy Patch-from: lvqcl --- src/share/grabbag/picture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/share/grabbag/picture.c b/src/share/grabbag/picture.c index ab8b5719..d183f808 100644 --- a/src/share/grabbag/picture.c +++ b/src/share/grabbag/picture.c @@ -28,6 +28,7 @@ #include #include #include "share/compat.h" +#include "share/safe_str.h" /* slightly different that strndup(): this always copies 'size' bytes starting from s into a NUL-terminated string. */ static char *local__strndup_(const char *s, size_t size) @@ -432,7 +433,7 @@ FLAC__StreamMetadata *grabbag__picture_from_specification(int type, const char * if (error_message == 0) return 0; - strncpy (mime_type, mime_type_in, sizeof (mime_type)); + safe_strncpy(mime_type, mime_type_in, sizeof (mime_type)); *error_message = 0;