INN commit: trunk/nnrpd (nnrpd.c)

INN Commit Russ_Allbery at isc.org
Thu Aug 28 06:36:03 UTC 2008


    Date: Wednesday, August 27, 2008 @ 23:36:03
  Author: iulius
Revision: 7982

It is even better if we break at the right place in the loop.
Note that it could generate a problem only if initial substrings
of NNTP commands were real NNTP commands (which is not the case).

Modified:
  trunk/nnrpd/nnrpd.c

---------+
 nnrpd.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Modified: nnrpd.c
===================================================================
--- nnrpd.c	2008-08-28 06:08:01 UTC (rev 7981)
+++ nnrpd.c	2008-08-28 06:36:03 UTC (rev 7982)
@@ -1123,12 +1123,14 @@
                 /* The line is too long but we have to make sure that
                  * no recognized command has been sent. */
                 validcommandtoolong = false;
-                for (cp = CMDtable; cp->Name; cp++)
+                for (cp = CMDtable; cp->Name; cp++) {
                     if (strncasecmp(cp->Name, p, strlen(cp->Name)) == 0) {
-                        if (p[strlen(cp->Name)] == ' ')
+                        if (p[strlen(cp->Name)] == ' ') {
                             validcommandtoolong = true;
-                        break;
+                            break;
+                        }
                     }
+                }
                 Reply("%d Line too long\r\n",
                       validcommandtoolong ? NNTP_ERR_SYNTAX : NNTP_ERR_COMMAND);
 		continue;



More information about the inn-committers mailing list