From 413f24de7c84e622d7a68d1257ff92457b953c24 Mon Sep 17 00:00:00 2001 From: SeokHoon Lee Date: Mon, 13 Jun 2016 19:58:23 +0900 Subject: [PATCH] fix buffer overflow in case of length of str equal to 255 Signed-off-by: SeokHoon Lee Change-Id: I192051c1eb739cf0bd7b4294c79a15ba9520e303 --- packaging/libmm-streamrecorder.spec | 2 +- src/mm_streamrecorder_ini.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/libmm-streamrecorder.spec b/packaging/libmm-streamrecorder.spec index 2583090..2f59972 100644 --- a/packaging/libmm-streamrecorder.spec +++ b/packaging/libmm-streamrecorder.spec @@ -1,6 +1,6 @@ Name: libmm-streamrecorder Summary: Media Stream Recorder library -Version: 0.0.7 +Version: 0.0.8 Release: 0 Group: Multimedia/Other License: Apache-2.0 diff --git a/src/mm_streamrecorder_ini.c b/src/mm_streamrecorder_ini.c index 49571f3..240e0ae 100644 --- a/src/mm_streamrecorder_ini.c +++ b/src/mm_streamrecorder_ini.c @@ -43,7 +43,7 @@ do { \ if (str) { \ length = strlen(str); \ if ((length > 1) && (length < STREAMRECORDER_INI_MAX_STRLEN)) \ - strncpy(x_item, str, length+1); \ + strncpy(x_item, str, STREAMRECORDER_INI_MAX_STRLEN-1); \ else \ strncpy(x_item, x_default, STREAMRECORDER_INI_MAX_STRLEN-1); \ } else { \ -- 2.7.4