On Fri, 22 Jul 2005 13:21:46 -0500 [EMAIL PROTECTED] wrote:
EYC> > This code is perfectly fine, and worked in the code I generated using
EYC> > 5.2.1 CVS. Something else must be going on with memory access...
EYC> 
EYC> Did you use ehterStatsTable to generate template?
EYC> The strange thing is if I not set etherStatsDataSource_len, the subagent
EYC> works just fine. Only when I set etherStatsDataSource_len to none-zero it
EYC> causes segmentation fault.

Not to non-zero, but something greater than 10.

I don't know how I haven't run across this in my testing, but I did track it
down. The length in the get function is supposed to be in bytes, and the
memcpy does take that into account. However, the size check at the top of the
function does not, thus the memcpy is overwriting the buffer. This will only
happen for objects that exceed the default buffer size (40 bytes).

Here is a patch that should fix this. Let me know if you still have problems...

http://sourceforge.net/tracker/index.php?func=detail&aid=1244838&group_id=12694&atid=456380

-- 
NOTE: messages sent directly to me, instead of the lists, will be deleted
      unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to