From 8a88ada9c5a0561c868618961f00042e89e593cc Mon Sep 17 00:00:00 2001 From: Jan Polensky Date: Mon, 15 Sep 2025 15:01:14 +0200 Subject: [PATCH] dasdinfo/dasdinfo.c: Fix string termination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use correct buffer and index to terminate string returned by readlink(). Reviewed-by: Juergen Christ Signed-off-by: Jan Polensky Signed-off-by: Jan Höppner --- dasdinfo/dasdinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dasdinfo/dasdinfo.c b/dasdinfo/dasdinfo.c index 4189b5af..41bc64b2 100644 --- a/dasdinfo/dasdinfo.c +++ b/dasdinfo/dasdinfo.c @@ -393,7 +393,7 @@ dinfo_is_busiddir(const char *fpath, const struct stat *UNUSED(sb), if (i < 0 || i >= LINK_DIR_SIZE) return -1; /* append '\0' because readlink returns non zero terminated string */ - tempdir[i + 1] = '\0'; + linkdir[i] = '\0'; if (strstr(linkdir, "dasd") == NULL) return FTW_CONTINUE; free(busiddir);