mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
dasdinfo/dasdinfo.c: Fix string termination
Use correct buffer and index to terminate string returned by readlink(). Reviewed-by: Juergen Christ <jchrist@linux.ibm.com> Signed-off-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
538bc7b4e8
commit
8a88ada9c5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user