aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZijun Hu <quic_zijuhu@quicinc.com>2023-05-26 16:47:33 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-30 11:12:12 +0200
commitce791de8e9ded220f39fbfe4cc5a0bd93b1e985f (patch)
tree577e4c08756d5b1659e8ed60493d4303acafcfae
parenta2f6201c501035ec02634b2fa7d261b003ec26bb (diff)
mkfs.ubifs: Fix mkfs.ubifs failure with option selinux
Below failure happens when mkfs.ubifs --selinux=FILE ... "Error: bad file context FILE 1" "No such file or directory (error 2)" It is fixed by this change. Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--ubifs-utils/mkfs.ubifs/mkfs.ubifs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
index 8211ada..15e6bdc 100644
--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
+++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
@@ -733,6 +733,7 @@ static int get_options(int argc, char**argv)
if (!context)
return err_msg("xmalloc failed\n");
memcpy(context, optarg, context_len);
+ context[context_len] = '\0';
/* Make sure root directory exists */
if (stat(context, &context_st))