Dave Shield wrote:
On 18 March 2010 07:34, sanjaykumar <[email protected]> wrote:
  
Hi I find many places in net-snmp code "compairing array with NULL"
    

Firstly, the code fragments which you quote appear to be part of the MfD
framework, which is nothing to do with me.   So I don't claim to have any
great knowledge or understanding of this code.

But it appears as if these checks are simply ensuring that a given index
field buffer exists (and has sufficient space) before copying a value into it.
Without such checks, it's potentially possible for a memory problem or
corrupt request to end up crashing the agent.

While I don't particularly like the MfD code, I fail to see what the problem
is that you are complaining about here.



  
Hope this will updated in next release of code.
    

I very much doubt it.
Unless you can show good reason why such validation checks should be removed.
  
I am not telling to remove the validation but update it
eg:
 In below code udpEndpointLocalAddress is an array hence "(NULL == tbl_idx->udpEndpointLocalAddress) " will be never VALID.

if ((NULL == tbl_idx->udpEndpointLocalAddress) ||
        (tbl_idx->udpEndpointLocalAddress_len <
         (udpEndpointLocalAddress_val_ptr_len))) {
        snmp_log(LOG_ERR, "not enough space for value\n");
        return MFD_ERROR;
    }

What is my concern that MODIFY it like below  or something else
so that check should be valid


if (('\0' == tbl_idx->udpEndpointLocalAddress[0]) ||
        (tbl_idx->udpEndpointLocalAddress_len <
         (udpEndpointLocalAddress_val_ptr_len))) {
        snmp_log(LOG_ERR, "not enough space for value\n");
        return MFD_ERROR;
    }
Dave

  


------------------------------------------------------------------------------
Download Intel&#174; 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to