Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
libqb.34760
bsc#1214066-fix-potential-overflow-with-long-lo...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc#1214066-fix-potential-overflow-with-long-log-messages.patch of Package libqb.34760
diff --git a/lib/log_blackbox.c b/lib/log_blackbox.c index baef379..c1ffb11 100644 --- a/lib/log_blackbox.c +++ b/lib/log_blackbox.c @@ -110,8 +110,8 @@ _blackbox_vlogger(int32_t target, chunk += sizeof(uint32_t); /* log message */ - msg_len = qb_vsnprintf_serialize(chunk, max_size, cs->format, ap); - if (msg_len >= max_size) { + msg_len = qb_vsnprintf_serialize(chunk, t->max_line_length, cs->format, ap); + if (msg_len >= t->max_line_length) { chunk = msg_len_pt + sizeof(uint32_t); /* Reset */ /* Leave this at QB_LOG_MAX_LEN so as not to overflow the blackbox */ diff --git a/tests/check_log.c b/tests/check_log.c index 039a4bb..3227e0e 100644 --- a/tests/check_log.c +++ b/tests/check_log.c @@ -832,8 +832,10 @@ START_TEST(test_log_long_msg) qb_log(LOG_INFO, "Message %d %d - %s", lpc, lpc%600, buffer); } - qb_log_blackbox_write_to_file("blackbox.dump"); - qb_log_blackbox_print_from_file("blackbox.dump"); + rc = qb_log_blackbox_write_to_file("blackbox.dump"); + ck_assert_int_gt(rc, 0); + rc = qb_log_blackbox_print_from_file("blackbox.dump"); + ck_assert_int_le(rc, 0); unlink("blackbox.dump"); qb_log_fini(); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor