diff options
Diffstat (limited to 'xpp/card_fxs.c')
-rw-r--r-- | xpp/card_fxs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xpp/card_fxs.c b/xpp/card_fxs.c index d5ade7b..9aaef63 100644 --- a/xpp/card_fxs.c +++ b/xpp/card_fxs.c @@ -989,8 +989,7 @@ static int process_slic_cmdline(xpd_t *xpd, char *cmdline) static int proc_xpd_slic_write(struct file *file, const char __user *buffer, unsigned long count, void *data) { xpd_t *xpd = data; - const int LINE_LEN = 500; - char buf[LINE_LEN]; + char buf[MAX_PROC_WRITE]; char *p; int i; int ret; @@ -998,7 +997,7 @@ static int proc_xpd_slic_write(struct file *file, const char __user *buffer, uns if(!xpd) return -ENODEV; for(i = 0; i < count; /* noop */) { - for(p = buf; p < buf + LINE_LEN; p++) { /* read a line */ + for(p = buf; p < buf + MAX_PROC_WRITE; p++) { /* read a line */ if(i >= count) break; if(get_user(*p, buffer + i)) @@ -1007,7 +1006,7 @@ static int proc_xpd_slic_write(struct file *file, const char __user *buffer, uns if(*p == '\n' || *p == '\r') /* whatever */ break; } - if(p >= buf + LINE_LEN) + if(p >= buf + MAX_PROC_WRITE) return -E2BIG; *p = '\0'; ret = process_slic_cmdline(xpd, buf); |