Skip to content

Commit a68e287

Browse files
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: nodejs#13577
1 parent 2d2986a commit a68e287

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

deps/uv/src/unix/aix.c

+1
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ int uv_fs_event_start(uv_fs_event_t* handle,
855855
uv__io_init(&handle->event_watcher, uv__ahafs_event, fd);
856856
handle->path = uv__strdup(filename);
857857
handle->cb = cb;
858+
handle->dir_filename = NULL;
858859

859860
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
860861

0 commit comments

Comments
 (0)