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]".
@@ -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;
