Big fix for core dump problem in OMAPI library

Mark Jason Dominus mjd at isc.upenn.edu
Fri Feb 6 20:12:32 UTC 2004


The values array manufactured for a remote object might contain null
values, represented by null pointers.  The 'omshell' program takes
this into account, so we suppose this is correct behavior.

The current version of omapi_generic_get_value does not correctly
handle this case, and dumps core when presented with an object that
contains null values.  This patch corrects the problem.

This patch (by Eric Chen), and the previous one I sent, are both
against the 3.0pl2 sources.

*** /tmp/T020ayJC       Thu Feb  5 09:38:07 2004
--- omapip/generic.c    Mon Feb  2 17:08:35 2004
***************
*** 187,196 ****
--- 187,198 ----
                 return ISC_R_INVALIDARG;
         g = (omapi_generic_object_t *)h;

         /* Look up the specified name in our list of objects. */
         for (i = 0; i < g -> nvalues; i++) {
+         if (!g -> values [i])
+           continue;
                 if (!omapi_data_string_cmp (name, g -> values [i] -> 
name)) {
                         /* If this is a name/null value pair, this is 
the
                            same as if there were no value that matched
                            the specified name, so return 
ISC_R_NOTFOUND. */
                         if (!g -> values [i] -> value)

---
Ecartis v1.0.0 - job execution complete.



More information about the dhcp-hackers mailing list