mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
Don't unconditionally deref pub and sub in lint_message_consistency
This can't actually result in a null pointer dereference, since pub_excl and sub_excl are only set when the corresponding smartlists are nonempty. But coverity isn't smart enough to figure that out, and we shouldn't really be depending on it. Bug 29938; CID 1444257. Bug not in any released Tor.
This commit is contained in:
parent
00ca3d04cf
commit
f58587a68d
@ -303,14 +303,14 @@ lint_message_consistency(message_id_t msg,
|
|||||||
/* Enforce exclusive-ness for publishers and subscribers that have asked for
|
/* Enforce exclusive-ness for publishers and subscribers that have asked for
|
||||||
* it.
|
* it.
|
||||||
*/
|
*/
|
||||||
if (pub_excl && smartlist_len(pub) > 1) {
|
if (pub_excl && smartlist_len_opt(pub) > 1) {
|
||||||
log_warn(LD_MESG|LD_BUG,
|
log_warn(LD_MESG|LD_BUG,
|
||||||
"Message \"%s\" has multiple publishers, but at least one is "
|
"Message \"%s\" has multiple publishers, but at least one is "
|
||||||
"marked as exclusive.",
|
"marked as exclusive.",
|
||||||
get_message_id_name(msg));
|
get_message_id_name(msg));
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
if (sub_excl && smartlist_len(sub) > 1) {
|
if (sub_excl && smartlist_len_opt(sub) > 1) {
|
||||||
log_warn(LD_MESG|LD_BUG,
|
log_warn(LD_MESG|LD_BUG,
|
||||||
"Message \"%s\" has multiple subscribers, but at least one is "
|
"Message \"%s\" has multiple subscribers, but at least one is "
|
||||||
"marked as exclusive.",
|
"marked as exclusive.",
|
||||||
|
Loading…
Reference in New Issue
Block a user