Hi,

I have compiled snmptrapd from 5.1.3 source on
Microsoft Windows Professional, Visual Studio VC++ 6.0

and it compiles fine.

But as I run it, it get access violation exception on
its third hit in the following code area. Note that I
have not made any modification to the source code yet.
Any help is appreciated.

Also, every other project snmpget, set, snmpnet.dll,
etc are compiling fine.

file snmp_api.c 

static struct session_list *
_sess_copy(netsnmp_session * in_session)
{
    struct session_list *slp;
    struct snmp_internal_session *isp;

...

    * session now points to the new structure that
still contains pointers to
     * data allocated elsewhere.  Some of this data is
copied to space malloc'd
     * here, and the pointer replaced with the new
one.
     */
---->>>>        session->peername = (char
*)malloc(strlen(in_session->peername) + 1);

    if (in_session->peername != NULL) {
        if (session->peername == NULL) {
            snmp_sess_close(slp);
            in_session->s_snmp_errno = SNMPERR_MALLOC;
            return (NULL);
        }
        strcpy(session->peername,
in_session->peername);
    }



                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to