diff options
Diffstat (limited to 'libmount/src/optstr.c')
-rw-r--r-- | libmount/src/optstr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c index 66d2a06c3..ca1b2e2c7 100644 --- a/libmount/src/optstr.c +++ b/libmount/src/optstr.c @@ -174,6 +174,8 @@ static int __mnt_optstr_append_option(char **optstr, size_t sz, osz; assert(name); + assert(*name); + assert(nsz); osz = *optstr ? strlen(*optstr) : 0; @@ -219,7 +221,7 @@ int mnt_optstr_append_option(char **optstr, const char *name, const char *value) { size_t vsz, nsz; - if (!name) + if (!name || !*name) return 0; nsz = strlen(name); |