Wireshark-dev: [Wireshark-dev] Segmentation fault in dissector
Hi , We are using a 32 bit machine and dissector is working fine.
The same dissector when used in a 64 bit m/c is giving problems. I would like
to know how is it going to get affected in the change of environment, because
initially it did not even compile properly .While testing in a 64 bit machine
the wireshark is getting crashed giving the following error: Inside unpack digits , length = 29 and offset is =
18 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 182924546464 (LWP 1776)] 0x0000002a9b46afb7 in unpack_digits (tvb=0x10dfbd8,
offset=18, dgt=0x2a9b588e78) at packet-xxx.c:4488 4488
digit_str[i]
= dgt->out[octet & 0x0f]; (gdb) The code for unpack digits is as
follows: static char* unpack_digits(tvbuff_t *tvb, int offset, dgt_set_t *dgt){ int length, length_fake,
offset_fake, counter=0; guint8 octet,
num_of_digits_imsi; int i=0; char *digit_str; length = tvb_length(tvb); printf("\n\nInside
unpack digits , length = %d and offset is = %d\n\n",length,offset); if (length < offset)
return ""; digit_str = ep_alloc((length
- offset)*2+1); offset_fake = offset-1; num_of_digits_imsi =
tvb_get_guint8(tvb,offset_fake); if( (num_of_digits_imsi % 2)
== 0 )
length_fake = num_of_digits_imsi / 2; else
length_fake = (num_of_digits_imsi+1)/2; printf("\noffset_fake =
%d\tnum_of_digits_imsi = %d\tlength_fake =
%d",offset_fake,num_of_digits_imsi,length_fake); while ( counter <
length_fake ){
octet = tvb_get_guint8(tvb,offset);
digit_str[i] = dgt->out[octet & 0x0f];
i++;
/* unpack second value in byte */
octet = octet >> 4;
if (octet == 0x0f) /* odd number bytes - hit
filler */
break;
digit_str[i] = dgt->out[octet & 0x0f]; i++;
offset++;
counter++; } digit_str[i]= '\0'; return digit_str; } Can anybody please help??? Regards, Tarani
|
- Prev by Date: Re: [Wireshark-dev] [PATCH] Packlog fix/enhancement
- Next by Date: Re: [Wireshark-dev] [Wireshark-commits] rev 21226: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-syslog.c
- Previous by thread: Re: [Wireshark-dev] FYI: Status of gcc warnings in epan/dissectors
- Next by thread: [Wireshark-dev] Segmentation fault in dissector
- Index(es):