Re: [PATCH] gst-tool: Fix ASAN issue on comparing options
Holger Freyther <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.gnu.general |
|---|---|
| Message-ID | <[email protected]> |
> On 12. Feb 2017, at 13:16, Holger Freyther <[email protected]> wrote: > Dear Paolo, >> Wouldn't the '\0' mismatch first? > > "Both strings are assumed to be n bytes long". I guess an optimized memcmp will fetch 32/64 bytes at a time (manual loop unrolling?). I noticed I didn't push this change yet. I think in the case ASAN reported, name and all_opts->name are of different size and 1-3 bytes after the \0 will be fetched? If I see this correctly right now we want to check if name is a prefix of all_opts->name? For this to be true all_opts->name must be at least as long as the prefix (name)? Am I wrong? holger