git: 8e857d9812fa - stable/14 - examples/inotify: Handle a zero-length name
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 05 Aug 2026 15:16:34 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=8e857d9812fa5dc02765d6f0e095269ced84cdf8
commit 8e857d9812fa5dc02765d6f0e095269ced84cdf8
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-07 13:51:41 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-08-05 15:15:15 +0000
examples/inotify: Handle a zero-length name
Reported by: jlduran
Fixes: 1d8664d69041 ("examples: Add a demo program for inotify")
(cherry picked from commit 97452b097a4a35df8ce8cbd44786fb7d95db2a92)
---
share/examples/inotify/inotify.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/share/examples/inotify/inotify.c b/share/examples/inotify/inotify.c
index b8e300bc992c..ea63ccd1f337 100644
--- a/share/examples/inotify/inotify.c
+++ b/share/examples/inotify/inotify.c
@@ -154,7 +154,7 @@ main(int argc, char **argv)
ev = ev2str(iev1->mask);
xo_open_instance("event");
xo_emit("{:wd/%3d} {:event/%16s} {:name/%s}\n",
- iev1->wd, ev, iev1->name);
+ iev1->wd, ev, iev1->len > 0 ? iev1->name : "");
xo_close_instance("event");
n -= sizeof(*iev1) + iev1->len;