chown: fix out-of-bounds ((null) bad address error)
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
parent
1d5663672e
commit
cd194d96ad
2
chown.c
2
chown.c
@ -32,11 +32,13 @@ main(int argc, char *argv[])
|
|||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
} ARGEND;
|
} ARGEND;
|
||||||
|
|
||||||
if(argc == 0)
|
if(argc == 0)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
owner = argv[0];
|
owner = argv[0];
|
||||||
argv++;
|
argv++;
|
||||||
|
argc--;
|
||||||
if((group = strchr(owner, ':')))
|
if((group = strchr(owner, ':')))
|
||||||
*group++ = '\0';
|
*group++ = '\0';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user