mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-14 09:36:31 +00:00
COVERITY 12: prevent overrun of logsys output buffers.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2547 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
28f7c1e51f
commit
34ddb1cb14
@ -527,8 +527,12 @@ static void log_printf_to_logs (
|
||||
syslog_output_buffer_idx += syslog_len;
|
||||
format_buffer_idx += 1;
|
||||
}
|
||||
if ((normal_output_buffer_idx == sizeof (normal_output_buffer)) ||
|
||||
(syslog_output_buffer_idx == sizeof (syslog_output_buffer))) {
|
||||
if ((normal_output_buffer_idx >= sizeof (normal_output_buffer) - 2) ||
|
||||
(syslog_output_buffer_idx >= sizeof (syslog_output_buffer) - 1)) {
|
||||
/* Note: we make allowance for '\0' at the end of
|
||||
* both of these arrays and normal_output_buffer also
|
||||
* needs a '\n'.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user