INN commit: trunk/nnrpd (nnrpd.c)

INN Commit rra at isc.org
Sat Oct 17 22:09:21 UTC 2009


    Date: Saturday, October 17, 2009 @ 15:09:19
  Author: iulius
Revision: 8670

Do not take into account leading white spaces in NNTP commands
in the RTlong case.

Modified:
  trunk/nnrpd/nnrpd.c

---------+
 nnrpd.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Modified: nnrpd.c
===================================================================
--- nnrpd.c	2009-10-17 20:53:18 UTC (rev 8669)
+++ nnrpd.c	2009-10-17 22:09:19 UTC (rev 8670)
@@ -1312,6 +1312,7 @@
 	    size_t len;
             size_t lenstripped = 0;
 	    const char *p;
+            char *q;
 
 	    r = line_read(&NNTPline, timeout, &p, &len, &lenstripped);
 	    switch (r) {
@@ -1358,14 +1359,14 @@
 	    case RTlong:
                 /* The line is too long but we have to make sure that
                  * no recognized command has been sent. */
+                q = (char *)p;
+                ac = Argify(q, &av);
                 validcommandtoolong = false;
                 for (cp = CMDtable; cp->Name; cp++) {
                     if ((cp->Function != CMD_unimp) &&
-                        (strncasecmp(cp->Name, p, strlen(cp->Name)) == 0)) {
-                        if (p[strlen(cp->Name)] == ' ') {
-                            validcommandtoolong = true;
-                            break;
-                        }
+                        (ac > 0 && strcasecmp(cp->Name, av[0]) == 0)) {
+                        validcommandtoolong = true;
+                        break;
                     }
                 }
                 Reply("%d Line too long\r\n",




More information about the inn-committers mailing list