From 09444560fe59df5ceaaa89f745a3b042925b71e5 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Tue, 4 Jul 2017 09:40:47 -0400 Subject: [PATCH] aix: fix un-initialized pointer field in fs handle On AIX, uv_fs_event_start() didn't always initialize handle->dir_filename. In this scenario, uv_fs_event_stop() would free the uninitialized pointer. This commit initialized handle->dir_filename to NULL in all cases. Fixes: https://github.com/nodejs/node/issues/13577 PR-URL: https://github.com/libuv/libuv/pull/1400 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis --- src/unix/aix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/unix/aix.c b/src/unix/aix.c index 388c9cca..426f7f47 100644 --- a/src/unix/aix.c +++ b/src/unix/aix.c @@ -855,6 +855,7 @@ int uv_fs_event_start(uv_fs_event_t* handle, uv__io_init(&handle->event_watcher, uv__ahafs_event, fd); handle->path = uv__strdup(filename); handle->cb = cb; + handle->dir_filename = NULL; uv__io_start(handle->loop, &handle->event_watcher, POLLIN);