Comment 5 for bug 861132

Revision history for this message
In , Robert Ancell (robert-ancell) wrote :

Could you please consider changing this line then:
  const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
to:
  const size_t vallen = strlen (value) + 1;

This is detecting that value is NULL, handling it, then causing a greater problem later on in the function. If value must be non NULL then a segmentation fault is preferable to a memory corruption which is much harded to diagnose.