On Thu, 16 Jan 2025, Sean McGovern wrote:

This feels like less of an issue with strncmp, and more of an issue with
the spec for main() and argc/argv; how do you do to end up with a NULL
entry in argv[i] for 0 <= i < argc?

If 'checkasm' is run without arguments, argv[i] would be NULL since argc == 1.

If we have argc == 1, and we run the loop "for (i = 1; i < argc; i++)", it will never even enter the loop body, right?

It only really tripped up on GCC with Address Sanitizer enabled, but
the comment regarding
how POSIX does not require a length check on either argument means we should
be defensive.

In fact, even 'checkasm --test=blah' triggered the segmentation fault
under ASan.

Sorry, I don't see how that would happen, and I can't reproduce it.

// Martin

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to