From 5d27dd094076ccb02ee387b7f9eb8bc7c24254e5 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 2 Jan 2015 12:56:14 +0100 Subject: [PATCH 1/1] frontend/scanner: Pass the right size to strncat. Thanks to clang for identifying this :-) --- src/frontend/scanner.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/scanner.l b/src/frontend/scanner.l index 65ec9ed..6781122 100644 --- a/src/frontend/scanner.l +++ b/src/frontend/scanner.l @@ -237,7 +237,7 @@ time ([0-9]{1,2}:[0-9]{1,2}(:[0-9]{1,2}(\.[0-9]{1,9})?)?) assert(tmp); tmp = strchr(tmp + 1, ':'); if (! tmp) - strncat(time, ":00", sizeof(time)); + strncat(time, ":00", sizeof(time) - strlen(time) - 1); if (! strptime(time, "%H:%M:%S", &tm)) { char errmsg[1024]; -- 2.30.2