client/x11: Silence false positive warnings from covscan

Add code annotation to silence false positive warnings from covscan
due to omitting termination \0.

buffer_size: Calling strncpy with a source string whose length (13 chars) is greater than or equal to the size argument (13) will fail to null-terminate "&tmp[cs]".
This commit is contained in:
Ondrej Holy 2018-08-21 09:07:15 +02:00
parent baeb29a7e0
commit e7d5aae514
1 changed files with 4 additions and 0 deletions

View File

@ -52,8 +52,10 @@ LPSTR tr_esc_str(LPCSTR arg, bool format)
}
if (format)
/* coverity[buffer_size] */
strncpy(&tmp[cs], "<replaceable>", len);
else
/* coverity[buffer_size] */
strncpy(&tmp[cs], "&lt;", len);
cs += len;
@ -71,8 +73,10 @@ LPSTR tr_esc_str(LPCSTR arg, bool format)
}
if (format)
/* coverity[buffer_size] */
strncpy(&tmp[cs], "</replaceable>", len);
else
/* coverity[buffer_size] */
strncpy(&tmp[cs], "&lt;", len);
cs += len;