From:	MERC::"uunet!VM1.NoDak.EDU!ANU-NEWS"  6-MAY-1992 20:46:50.58
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 <1992May6.094649.6023@dayton.saic.com>, ake@dayton.saic.com (Earle Ak
e) writes:

>       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.


        Actually a better fix that Pat Rankin pointed out would be the
following.  This way if loc_cmd changed length, the other code would not need
to be changed.


-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]) > (sizeof(loc_cmd) - 1))
+     argv[CONTROL][sizeof(loc_cmd)-1] = '\0';
    strcpy(loc_cmd,argv[CONTROL]);
    lower_case(loc_cmd);
