On 03/05/2010 04:44 PM, Jan Safranek wrote:
> Hi,
>
> I've stumbled upon snmpd processing malformed requests. How should
> snmplib react to it? E.g. my snmpd received get-request with ASN.1 error
> in Request ID - instead of Type: 2, Length: 1, Value: 0xc it received
> Type: 32, which is wrong. But the request got processed and answered,
> nothing checks for type of Request-ID component. And I've noticed that
> there are no such checks in general, not only Request-ID... Is it
> feature or a bug? IMHO such malformed packets should be silently
> discarded. Would you mind if I add checks to appropriate asn_parse_xxx?
> Or is it up to the caller to check returned type and I shall add the
> checks there? It's more work this way ;).

Based on yesterday's conversation, I prepared a patch with solution #2 
(put it inside asn_parse_foo (which may not be possible)). My simple 
tests show that it works, see patch tracker for details:
https://sourceforge.net/tracker/?func=detail&aid=2971270&group_id=12694&atid=312694

I'd welcome comments and test ideas, this changes the basic packet 
processing and we don't want regressions, do we?

Jan

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to