After installing LPRng on AIX i found that lpstat often coredumped,
and when trying it out on a linux system it coredumped as well.

The problem I narrowed down to line 346 in lpstat.c where the loop
test is not testing for end of string, and therefore some byte
in physical memory after the Printer_DYN string is modified.

Testing for both t and *t may be an overkill as testing for *t
alone would terminate the loop long before testing for t would.

Villy


*** LPRng-3.8.5/src/common/lpstat.c.orig        Wed Jan 23 02:01:19 2002
--- LPRng-3.8.5/src/common/lpstat.c     Mon Jan 28 17:28:54 2002
***************
*** 8,14 ****
   ***************************************************************************/
  
   static char *const _id =
! "$Id: lpstat.c,v 1.2 2002/01/23 01:01:19 papowell Exp $";
  
  
  /***************************************************************************
--- 8,14 ----
   ***************************************************************************/
  
   static char *const _id =
! "$Id: lpstat.c,v 1.2new_version 2002/01/23 01:01:19 papowell Exp $";
  
  
  /***************************************************************************
***************
*** 343,349 ****
                                        ++t;
                                        while( isspace(cval(t)) ) ++t;
                                        Set_DYN(&Printer_DYN,t );
!                                       for( t = Printer_DYN; t && !isspace(cval(t)); 
++t );
                                        if( isspace(cval(t)) ) *t = 0;
                                }
                                if( display_format == 0 ){
--- 343,349 ----
                                        ++t;
                                        while( isspace(cval(t)) ) ++t;
                                        Set_DYN(&Printer_DYN,t );
!                                       for( t = Printer_DYN; t && *t && 
!isspace(cval(t)); ++t );
                                        if( isspace(cval(t)) ) *t = 0;
                                }
                                if( display_format == 0 ){


-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to