Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57736
b: refs/heads/master
c: 2c8307f
h: refs/heads/master
v: v3
  • Loading branch information
Alexandr Andreev authored and Kyle McMartin committed May 23, 2007
1 parent 6fb239e commit 39c9ca6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01da41b86f6e5f9a724e20a63f093d77e37d8056
refs/heads/master: 2c8307f63dd5caaf7ff8ad5118951e559a9ed5c8
10 changes: 8 additions & 2 deletions trunk/arch/parisc/kernel/sys_parisc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count)
struct getdents32_callback buf;
int error;

error = -EFAULT;
if (!access_ok(VERIFY_WRITE, dirent, count))
goto out;

error = -EBADF;
file = fget(fd);
if (!file)
Expand All @@ -366,8 +370,10 @@ sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count)
error = buf.error;
lastdirent = buf.previous;
if (lastdirent) {
put_user(file->f_pos, &lastdirent->d_off);
error = count - buf.count;
if (put_user(file->f_pos, &lastdirent->d_off))
error = -EFAULT;
else
error = count - buf.count;
}

out_putf:
Expand Down

0 comments on commit 39c9ca6

Please sign in to comment.