On Sat, 9 May 2009 21:34:09 +0400 Aleksandras wrote:
ANL> Hi all !
ANL> 
ANL> In file snmp_client.c function snmp_clone_var():
ANL> 
ANL>     /*
ANL>      * need a pointer to copy a string value.
ANL>      */
ANL>     if (var->val.string) {
ANL>         if (var->val.string != &var->buf[0]) {
ANL>             if (var->val_len <= sizeof(var->buf))
ANL>                 newvar->val.string = newvar->buf;
ANL>             else {
ANL>                 newvar->val.string = (u_char *) malloc(var->val_len);
ANL>                 if (!newvar->val.string)
ANL>                     return 1;
ANL>             }
ANL> ------            memmove(newvar->val.string, var->val.string,
ANL> var->val_len);
ANL>         } else {                /* fix the pointer to new local store */
ANL>             newvar->val.string = newvar->buf;
ANL>         }
ANL> ++++++        memmove(newvar->val.string, var->val.string, var->val_len);
ANL>     } else {
ANL>         newvar->val.string = 0;
ANL>         newvar->val_len = 0;
ANL>     }
ANL> 


By golly, I think it is... and it's been around for at least 10 years..

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to