X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fbinfmt_misc.c;h=97aff2879cda3c1f9295d6e480a4e737e48e3df2;hb=f12e77caf6c21588d6b24b5f1d8a6036f9ff9378;hp=c04ef1d4f18a573726f83d7f5a1401f06ec9652b;hpb=e589c9e13aeb0c5539bf1314b3a78442ea8fc0c2;p=cascardo%2Flinux.git diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index c04ef1d4f18a..97aff2879cda 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -254,6 +254,7 @@ static char *scanarg(char *s, char del) return NULL; } } + s[-1] ='\0'; return s; } @@ -378,8 +379,7 @@ static Node *create_entry(const char __user *buffer, size_t count) p = scanarg(p, del); if (!p) goto einval; - p[-1] = '\0'; - if (p == e->magic) + if (!e->magic[0]) goto einval; if (USE_DEBUG) print_hex_dump_bytes( @@ -391,8 +391,7 @@ static Node *create_entry(const char __user *buffer, size_t count) p = scanarg(p, del); if (!p) goto einval; - p[-1] = '\0'; - if (p == e->mask) { + if (!e->mask[0]) { e->mask = NULL; pr_debug("register: mask[raw]: none\n"); } else if (USE_DEBUG)