Ticket #201 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

выпадение sams в segfault

Reported by: qmax@… Owned by: PavelVinogradov
Priority: critical Milestone: sams-1.0.3
Component: demons Version: 1.0.1
Keywords: Cc:

Description (last modified by PavelVinogradov) (diff)

вот здесь, demon.c:

    163       while(ENDVALUE2<NEWENDVALUE)
    164         {
    165            LOCALURL=0;
    166            count++;
    167            if (TestInputString(fgets( &buf[0], BUFFER_SIZE-1, finp ))==-1)
    168              {

когда fgets возвращает NULL из-за ошибки чтения или вот тут, logtool.c:

    104 int TestInputString(char *str)
    105 {
    106   int i,space,scount;
    107   if(strlen(str)<60)
    108     {      
    109       if(DEBUG>0)

strlen вываливается в segfault.

что случилось на моём логфайле по непонятным пока причинам

Attachments

Change History

Changed 2 years ago by anonymous

случился "Bad file descriptor"

sams к подобным ошибкам не готов...

Changed 2 years ago by PavelVinogradov

  • priority changed from major to critical
  • status changed from new to assigned
  • milestone changed from sams-1.1.0 to sams-1.0.2

А IMHO должен.

Changed 2 years ago by PavelVinogradov

  • description modified (diff)

Changed 2 years ago by PavelVinogradov

Предлагаю такой патч. Дмитрий, please review

  [21:45] svn diff logtool.c                                                                                                            
  Index: logtool.c
  ===================================================================
  --- logtool.c	(revision 395)
  +++ logtool.c	(working copy)
  @@ -104,6 +104,15 @@
   int TestInputString(char *str)
   {
     int i,space,scount;
  +  if(str == NULL)
  +    {
  +      if(DEBUG>0)
  +        {
  +          printf("\n*** ERROR: Input string is NULL \n");
  +	  return(-1);
  +	}  
  +    }  
  +
     if(strlen(str)<60)
       {
         if(DEBUG>0)

Changed 2 years ago by PavelVinogradov

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [418]

Add/Change #201 (выпадение sams в segfault)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.