On Saturday 13 June 2009 08:34:49 pm Brad Hards wrote:
>  pdf_time_span_negate (pdf_time_span_t *p_span)
>  {
>    pdf_status_t p_status = PDF_OK;
> +  if ( p_span == NULL )
> +    {
> +      return PDF_ERROR;
> +    }
>    pdf_i64_neg(p_span, *p_span, &p_status);
> -  return PDF_OK;
> +  return p_status;
>  }
On further thought, whether that is the right fix depends on whether 
pdf_i64_neg() should assume that its argument might be NULL (and therefore 
check) or not. 

This query is generally applicable - should the pdf_types.h operations protect 
against NULL pointers, or should they assume that their arguments are already 
protected by higher level functions?

Brad




Reply via email to