From 9ebee03178b14c7a4fbe7c75d5bbfc44121f37cc Mon Sep 17 00:00:00 2001 From: tosiara Date: Mon, 17 Feb 2014 06:45:23 +1100 Subject: [PATCH] Buffer overflow issue --- motion.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/motion.c b/motion.c index d2384734..ceaa44d2 100644 --- a/motion.c +++ b/motion.c @@ -2714,8 +2714,12 @@ int main (int argc, char **argv) cnt_list[i]->threadnr = i ? i : 1; if (strcmp(cnt_list[i]->conf_filename, "")) + { + cnt_list[i]->conf_filename[sizeof(cnt_list[i]->conf_filename) - 1] = '\0'; + MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: Thread %d is from %s", cnt_list[i]->threadnr, cnt_list[i]->conf_filename); + } MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: Thread %d is device: %s input %d", cnt_list[i]->threadnr, cnt_list[i]->conf.netcam_url ?