]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd-ctrls-reqarglen.patch
- readd for head
[packages/proftpd.git] / proftpd-ctrls-reqarglen.patch
1 Index: src/ctrls.c
2 ===================================================================
3 RCS file: /cvsroot/proftp/proftpd/src/ctrls.c,v
4 retrieving revision 1.14
5 diff -u -r1.14 ctrls.c
6 --- src/ctrls.c 24 Oct 2006 16:13:31 -0000      1.14
7 +++ src/ctrls.c 8 Dec 2006 17:02:34 -0000
8 @@ -534,11 +534,20 @@
9      return -1;
10    }
11  
12 +  if (reqarglen >= sizeof(reqaction)) {
13 +    pr_signals_unblock();
14 +    errno = ENOMEM;
15 +    return -1;
16 +  }
17 +
18 +  memset(reqaction, '\0', sizeof(reqaction));
19 +
20    if (read(cl->cl_fd, reqaction, reqarglen) < 0) {
21      pr_signals_unblock();
22      return -1;
23    }
24  
25 +  reqaction[sizeof(reqaction)-1] = '\0';
26    nreqargs--;
27  
28    /* Find a matching action object, and use it to populate a ctrl object,
29 @@ -657,17 +666,16 @@
30        return -1;
31      }
32  
33 -    memset(response, '\0', sizeof(response));
34 -
35      /* Make sure resparglen is not too big */
36 -    if (resparglen > sizeof(response)) {
37 +    if (resparglen >= sizeof(response)) {
38        pr_signals_unblock();
39        errno = ENOMEM;
40        return -1;
41      }
42  
43 -    bread = read(ctrls_sockfd, response, resparglen);
44 +    memset(response, '\0', sizeof(response));
45  
46 +    bread = read(ctrls_sockfd, response, resparglen);
47      while (bread != resparglen) {
48        if (bread < 0) {
49          pr_signals_unblock(); 
This page took 0.031858 seconds and 4 git commands to generate.