aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/ubi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libbb/ubi.c b/libbb/ubi.c
index 34595d797..a90016acf 100644
--- a/libbb/ubi.c
+++ b/libbb/ubi.c
@@ -35,6 +35,7 @@ int FAST_FUNC ubi_get_volid_by_name(unsigned ubi_devnum, const char *vol_name)
if (open_read_close(fname, buf, sizeof(buf)) <= 0)
continue;
+ buf[UBI_MAX_VOLUME_NAME] = '\0';
strchrnul(buf, '\n')[0] = '\0';
if (strcmp(vol_name, buf) == 0)
return i;