From a68e28707cc20d553003ccfbe3dc1f09a0c20e91 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Tue, 4 Jul 2017 07:37:46 -0400 Subject: [PATCH] aix: fix un-initialized pointer field in fs handle In AIX, fs watch close call was corrupting memory in the compiler. The handle->dir_filename field can be un-initialized, if the watch is initiated but not event got fired. But the uv_fs_event_stop was freeing this pointer as if it was malloc'ed, leading to the crash. Properly initialize handle-dir_filename to avoid a garbage pointer. Fixes: https://github.com/nodejs/node/issues/13577 --- deps/uv/src/unix/aix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/uv/src/unix/aix.c b/deps/uv/src/unix/aix.c index 388c9cca9707ee..426f7f4735fd39 100644 --- a/deps/uv/src/unix/aix.c +++ b/deps/uv/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);