noice.c | 1 + diff --git a/noice.c b/noice.c index 8d6f0d753e68dc88786f8b117698c13e93913690..66d856bc586722351cd4ba50c87df7c45db29931 100644 --- a/noice.c +++ b/noice.c @@ -234,6 +234,7 @@ /* Skip self and parent */ if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0) continue; + /* Deep copy because readdir(3) reuses the entries */ dents = realloc(dents, (n + 1) * sizeof(*dents)); if (dents == NULL) printerr(1, "realloc");