summaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/ubirename.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ubi-utils/ubirename.c b/ubi-utils/ubirename.c
index f88ef82..97bf030 100644
--- a/ubi-utils/ubirename.c
+++ b/ubi-utils/ubirename.c
@@ -126,6 +126,13 @@ int main(int argc, char * const argv[])
rnvol.ents[count].vol_id = err;
rnvol.ents[count].name_len = strlen(argv[i + 1]);
+
+ if (rnvol.ents[count].name_len >=
+ sizeof(rnvol.ents[count].name)) {
+ errmsg("\"%s\" volume name too long", argv[i + 1]);
+ goto out_libubi;
+ }
+
strcpy(rnvol.ents[count++].name, argv[i + 1]);
}