Fix null-pointer deref in SYS_readlink()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 30 Apr 2019 00:44:50 +0000 (20:44 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 30 Apr 2019 00:48:07 +0000 (20:48 -0400)
commit25e7634e8833ba2725901ad6bc9014e549bd2fc7
tree4996b5eabdb8d067d73c98da4cab8dfe5fcead0c
parentd48eeaff50a4560b780a0f547c5648af8bd5a145
Fix null-pointer deref in SYS_readlink()

We weren't checking the return value, which is NULL when namec() fails
to look up the path.

Incidentally, paths that go through copy_in_path() can be "", at least
under the current code.

Reported-by: syzbot+c9d58a7d1582d003ea18@syzkaller.appspotmail.com
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/syscall.c