From: Sebastian Harl Date: Fri, 2 Jan 2015 11:56:14 +0000 (+0100) Subject: frontend/scanner: Pass the right size to strncat. X-Git-Tag: sysdb-0.7.0~86 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5d27dd094076ccb02ee387b7f9eb8bc7c24254e5;p=sysdb.git frontend/scanner: Pass the right size to strncat. Thanks to clang for identifying this :-) --- 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];