From 974a57f68b56d9fa16eb2144ce5001def5ced9fc Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 25 Sep 2014 11:26:54 +0300 Subject: [PATCH] Make sure to always end a buffer --- src/modems/hayes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modems/hayes.c b/src/modems/hayes.c index 531c99b..b2ff28f 100644 --- a/src/modems/hayes.c +++ b/src/modems/hayes.c @@ -4065,6 +4065,7 @@ static void _on_code_cusd(HayesChannel * channel, char const * answer) /* FIXME really implement */ if(sscanf(answer, "%u\"%31[^\"]\",%u", &u, buf, &u) >= 2) { + buf[sizeof(buf) - 1] = '\0'; event->notification.content = buf; hayes->helper->event(hayes->helper->modem, event); }