Wireshark-dev: Re: [Wireshark-dev] [libsmi] Re: Building libsmi from SVN as a .dll
From: Andrew Hood <ajhood@xxxxxxxxx>
Date: Thu, 17 Apr 2008 01:09:33 +1000
Juergen Schoenwaelder wrote:
> On Wed, Apr 16, 2008 at 09:22:38AM +1000, Andrew Hood wrote:
>  
> 
>>I think I have also tracked down one of the reasons wireshark crashes.
> 
> 
> [...]
>  
> 
>>At line 595 oids.c calls smiRenderOID to format the node. The implicit
>>node is not completely filled in, and wireshark/tshark crashes in
>>libsmi. This is not totally unreasonable since implicit nodes should
>>never be seen.
> 
> 
> A crash _inside_ libsmi is not really acceptable; smiRenderOID should 
> return NULL if it can't do what the caller wants. So I created a sample
> MIB and a little program to test this (see attachment) and I found
> where things go wrong.
> 
> Attached is a patch which causes smiRenderOID() to render the OID
> as a sequence of numbers in case it is called with SMI_RENDER_NAME
> or SMI_RENDER_QUALIFIED and the label of the node is not known. But
> this might not be the right thing to do; it might be better to
> fail by returning NULL so that the caller gets control of what
> should happen. On the other hand, we always append numeric OIDs.

Juergen's patch cures the wireshark/tshark crashes.

-- 
There's no point in being grown up if you can't be childish sometimes.
                -- Dr. Who