Skip to content

Commit dfa1434

Browse files
committed
logsrvd_queue_scan: check for snprintf() return value < 0
Found by the ZeroPath AI Security Engineer <https://zeropath.com>
1 parent 4ed05da commit dfa1434

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

logsrvd/logsrvd_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ logsrvd_queue_scan(struct sudo_event_base *evbase)
215215

216216
dirlen = snprintf(path, sizeof(path), "%s/outgoing/%s",
217217
logsrvd_conf_relay_dir(), uuid_template);
218-
if (dirlen >= ssizeof(path)) {
218+
if (dirlen < 0 || dirlen >= ssizeof(path)) {
219219
errno = ENAMETOOLONG;
220220
sudo_warn("%s/outgoing/%s", logsrvd_conf_relay_dir(), uuid_template);
221221
debug_return_bool(false);

0 commit comments

Comments
 (0)