Skip to content
Snippets Groups Projects
Commit 044c1e19 authored by Nikolay Shirokovskiy's avatar Nikolay Shirokovskiy Committed by Vladimir Davydov
Browse files

say: check size before write

We potentially pass negative size to safe_write in say_default if total
is negative. We can't hit this issue currently because formatting
functions currently do not return -1. Yet let's check total value where
appropriate.

By the way fix restoring errno in log_vsay. format_log_entry_full is
introduced for this purpuse as SNPRINT macro returns in case of error.

Also add assertion to safe_write.

This patch addresses coverity complain 1527154
(https://scan7.scan.coverity.com/reports.htm#v43693/p13437/fileInstanceId=129123623&defectInstanceId=18608452&mergedDefectId=1527154)

Part of #7913

NO_DOC=code health
NO_CHANGELOG=code health
NO_TEST=code health
parent 1d954825
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment