Browse Source

prevent endless read of proc/status file

git.mgm/mediaproxy-ng/origin/mr3.2
Richard Fuchs 12 years ago
parent
commit
e0e98bb31f
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      kernel-module/xt_MEDIAPROXY.c

+ 4
- 1
kernel-module/xt_MEDIAPROXY.c View File

@ -578,7 +578,9 @@ static ssize_t proc_status(struct file *f, char __user *b, size_t l, loff_t *o)
unsigned long flags;
u_int32_t id;
if (*o)
if (*o > 0)
return 0;
if (*o < 0)
return -EINVAL;
if (l < sizeof(buf))
return -EINVAL;
@ -600,6 +602,7 @@ static ssize_t proc_status(struct file *f, char __user *b, size_t l, loff_t *o)
if (copy_to_user(b, buf, len))
return -EFAULT;
*o += len;
return len;
}


Loading…
Cancel
Save