Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UTILS: inotify: avoid potential NULL deref
Fixes following error: ``` Error: STRING_NULL (CWE-170): sssd-2.9.1/src/util/inotify.c:298: string_null_source: Function ""read"" does not terminate string ""ev_buf"". [Note: The source code implementation of the function has been overridden by a builtin model.] sssd-2.9.1/src/util/inotify.c:316: var_assign_var: Assigning: ""ptr"" = ""ev_buf"". Both now point to the same unterminated string. sssd-2.9.1/src/util/inotify.c:320: var_assign_var: Assigning: ""in_event"" = ""ptr"". Both now point to the same unterminated string. sssd-2.9.1/src/util/inotify.c:327: string_null: Passing unterminated string ""in_event->name"" to ""process_dir_event"", which expects a null-terminated string. # 325| # 326| if (snctx->wctx->dir_wd == in_event->wd) { # 327|-> ret = process_dir_event(snctx, in_event); # 328| } else if (snctx->wctx->file_wd == in_event->wd) { # 329| ret = process_file_event(snctx, in_event); ``` -- it might be unsafe to dereference `in_event->name` if `in_event->len == 0`
- Loading branch information