Browse Source

Pleasing Coverity for the improbable case that a builtin error message

length exceeds 4095 bytes.
release-1.5.4.branch
Thomas Schmitt 6 years ago
parent
commit
f3b836194c
  1. 3
      libisofs/messages.c

3
libisofs/messages.c

@ -569,7 +569,8 @@ int iso_msg_submit(int imgid, int errcode, int causedby, const char *fmt, ...)
vsnprintf(msg, MAX_MSG_LEN, fmt, ap);
va_end(ap);
} else {
strncpy(msg, iso_error_to_msg(errcode), MAX_MSG_LEN);
strncpy(msg, iso_error_to_msg(errcode), MAX_MSG_LEN - 1);
msg[MAX_MSG_LEN - 1] = 0;
}
libiso_msgs_submit(libiso_msgr, imgid, ISO_ERR_CODE(errcode),

Loading…
Cancel
Save