From:	MERC::"uunet!VM1.NoDak.EDU!ANU-NEWS"  6-MAY-1992 20:44:53.46
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>
CC:	
Subj:	Re: Recent news article causes access violation on 6.1 alpha4

In article <1992May5.150833.39931@kuhub.cc.ukans.edu>, sloane@kuhub.cc.ukans.edu
 (Bob Sloane) writes:
> In article <1992May5.145527.6020@dayton.saic.com>, ake@dayton.saic.com (Earle
Ake) writes:
>>      I had a little problem with a malformed news article on ANU-News
>> 6.1 alpha4.  The article kept causing an access violation and news was not
>> being posted.  I located the article and after removing it, news was again
>> posted without problems.  Here is the offending article and the error from
>> newsskim.log.
>
> The article is is mal-formed.  The line after the References: header
> contains a single blank, which indicates a continuation line, and the
> entire text of the article also looks like continuation lines. I
> suspect they are overflowing some buffer somewhere for storing headers.

        I found and fixed the problem.  In newscontrol.c there is a strcpy
from one string to another without checking the strlen.  I added a check and
truncated the string at 131 characters if it is too long.  This fixed the
problem but does not have the blessing of Geoff yet.


-Earle


*** newscontrol.c;24
--- newscontrol.c
**************
*** 945,950
  {
    char loc_cmd[132];

    strcpy(loc_cmd,argv[CONTROL]);
    lower_case(loc_cmd);

--- 945,952 -----
  {
    char loc_cmd[132];

+   if (strlen(argv[CONTROL]) > 131)
+     argv[CONTROL][131] = '\0';
    strcpy(loc_cmd,argv[CONTROL]);
    lower_case(loc_cmd);
