[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in nam1.0a8 there again...



Hi!

It seems that this bug has come back again (see old thread below).
However, it seems to be a virus, not a bug, since it doubled itself
:-)

--- trace.cc:line 487ff

      case 'p':
	/*packet type*/
	{
	  char *tmp;
	  strncpy(pe->pkt.type, value, PTYPELEN);
	  tmp=strchr(pe->pkt.type, ' ');
	  if (tmp==NULL)
	    tmp=strchr(pe->pkt.type, '\n');
	  if ((tmp!=NULL)&&(tmp-pe->pkt.type<=PTYPELEN))
	    *tmp='\0';
	  str+=strlen(pe->pkt.convid)+2;
------------------------------^^^^^^
	  break;
	}
      case 'k':
	/*packet type*/
	{
	  char *tmp;
	  strncpy(pe->pkt.wtype, value, PTYPELEN);
	  tmp=strchr(pe->pkt.wtype, ' ');
	  if (tmp==NULL)
	    tmp=strchr(pe->pkt.wtype, '\n');
	  if ((tmp!=NULL)&&(tmp-pe->pkt.wtype<=PTYPELEN))
	    *tmp='\0';
	  str+=strlen(pe->pkt.convid)+2;
------------------------------^^^^^^
	  break;
	}

The lines should look like 

	  str+=strlen(pe->pkt.type)+2;

and

	  str+=strlen(pe->pkt.wtype)+2;

respectively.

Best regards,

/J"org

>Thanks for your report. The bug has been fixed now.
>
>Satish
>
>> Hi,
>> 
>> As always, I saw too late that there is a mailing list for reporting
>> bugs... 
>> 
>> Ciao,
>> /J"org
>> 
>> ----------------------------
>> Hi!
>> 
>> Looking a little into the nam tracefile parser (trace.cc), I found a
>> strange part in the function Trace::packetscan (line 464pp):
>> 
>> ------------ snip-snip
>>       case 'c':
>>       /*conversation*/
>>       {
>>         char *tmp;
>>         check++;
>>         strncpy(pe->pkt.convid, value, CONVLEN);
>>         tmp=strchr(pe->pkt.convid, ' ');
>>         if (tmp==NULL)
>>           tmp=strchr(pe->pkt.convid, '\n');
>>         if ((tmp!=NULL)&&(tmp-pe->pkt.convid<=CONVLEN))
>>           *tmp='\0';
>>         str+=strlen(pe->pkt.convid)+2;
>>         break;
>>       }
>>       case 'p':
>>       /*packet type*/
>>       {
>>         char *tmp;
>>         strncpy(pe->pkt.type, value, PTYPELEN);
>>         tmp=strchr(pe->pkt.type, ' ');
>>         if (tmp==NULL)
>>           tmp=strchr(pe->pkt.type, '\n');
>>         if ((tmp!=NULL)&&(tmp-pe->pkt.type<=PTYPELEN))
>>           *tmp='\0';
>>         str+=strlen(pe->pkt.convid)+2;
>> ------------------------------^^^^^^
>>         break;
>>       }
>> /----------- snip-snip
>> 
>> It seems to me that the marked line should look like the following,
>> meaning that possibly someone forgot to modify it after copy+paste it...
>> 
>>         str+=strlen(pe->pkt.type)+2;
>> ------------------------------^^^^
>> 
>> /J"org
>> 
>> -----
>> J"org Diederich
>> Institute of Operating Systems and Computer Networks, 
>> Technical University Braunschweig, Germany
>> e-mail: [email protected]