From a46fe252837de263a9bff7deb74c3f706b818c6f Mon Sep 17 00:00:00 2001 From: AZ Huang Date: Tue, 6 May 2014 03:39:09 +0800 Subject: [PATCH] Force terminate filename. --- src/chat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chat.c b/src/chat.c index 2921690..8d9e7bb 100644 --- a/src/chat.c +++ b/src/chat.c @@ -228,6 +228,8 @@ static void chat_onFileSendRequest(ToxWindow *self, Tox *m, int32_t num, uint8_t uint8_t msg[MAX_STR_SIZE]; uint8_t *errmsg; + pathname[path_len] = '\0'; + uint8_t filename[MAX_STR_SIZE]; get_file_name(pathname, filename);