If po->fieldName is NULL then numFieldName won't be incremented and will remain zero. In the check you reference we check (j < numFieldName) which will check the j in the range 0..nFields for being less than zero. The code thus does seem quite correct to me.