diff options
author | Sungmin Choi <sungmin.choi@lge.com> | 2013-02-25 15:37:51 +0900 |
---|---|---|
committer | Sungmin Choi <sungmin.choi@lge.com> | 2013-02-25 15:39:45 +0900 |
commit | 192238d9081d4ad8c090a77e8e1d40b66e8fae4a (patch) | |
tree | 67aa6600bdee35dbadbf36be635d5cc07b98a6e7 /ext4_utils | |
parent | 3130a32fd910f424a9d6b811ed23d9a552004c81 (diff) | |
download | extras-192238d9081d4ad8c090a77e8e1d40b66e8fae4a.tar.gz |
ext4_utils: fix build error without FILE_CONTEXTS
After commit 4df62f342dbbe2f5cca831ce789dc0426d32ec03,
occurs segmentation fault if mkuserimg.sh runs without FILE_CONTEXTS options.
It's due to strlen() for null value. To fix it, return 0 for null.
Change-Id: Icf99706e51b9053a24e23b9d081a258962877c30
Diffstat (limited to 'ext4_utils')
-rw-r--r-- | ext4_utils/contents.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c index 48996483..586e97e6 100644 --- a/ext4_utils/contents.c +++ b/ext4_utils/contents.c @@ -467,6 +467,9 @@ static int xattr_add(u32 inode_num, int name_index, const char *name, int inode_set_selinux(u32 inode_num, const char *secon) { + if (!secon) + return 0; + return xattr_add(inode_num, EXT4_XATTR_INDEX_SECURITY, XATTR_SELINUX_SUFFIX, secon, strlen(secon) + 1); } |