<div dir="ltr"><div>> This demonstrates that your patch <br>
> is clearly insufficient. Further, Vladimir's patch is clearly <br>
> insufficient too, as shown for the another patch in the same <br>
> patch series.</div><div><br></div><div>"Insufficient" only when compared to a hypothetical perfectly exhaustive patch that requires "huge work," as you put it. It's best not to let the perfect be the enemy of the good.</div><div><br></div><div>Avoiding UB in normal program execution (as opposed to the test suite) will prevent common workloads from executing UB, which is not merely an issue of "theoretical correctness." See <a href="https://blog.regehr.org/archives/213">https://blog.regehr.org/archives/213</a> (section "A Fun Case Analysis") for an example of how this "NULL used in nonnull context" issue leads to unexpected program behavior.<br></div><div><br></div><div>Thus, I think the best approach is to patch pstrdup to avoid memcpy-from-NULL, and patch other functions only if someone can present a backtrace from a real configuration of nginx that executed UB.<br></div><div><br></div><div>-Ben<br></div></div>