diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index dd4dc1a..995b3f2 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -207,8 +207,10 @@ void change_notify_reply(struct smb_request *req, * coalescing and thus dropping events in notify_marshall_changes. */ - qsort(notify_buf->changes, notify_buf->num_changes, - sizeof(*(notify_buf->changes)), compare_notify_change_events); + if(notify_buf->num_changes > 0) { + qsort(notify_buf->changes, notify_buf->num_changes, + sizeof(*(notify_buf->changes)), compare_notify_change_events); + } if (!notify_marshall_changes(notify_buf->num_changes, max_param, notify_buf->changes, &blob)) {