3 ms·
Looking at the source, this is where the alarm bells should go off in a reviewer's head: memcpy(filter->buffer, output->piu_text_utf8, sizeof(output->piu_t
by itistoday2 11y ago
Looking at the source, this is where the alarm bells should go off in a reviewer's head:
memcpy(filter->buffer, output->piu_text_utf8, sizeof(output->piu_text_utf8));
1. memcpy is less safe than memmove and strncpy. strncpy should be used.
2. The two character arrays should use the same constant in defining their length, and that constant should be used both in the struct definitions and here in the copy operation.
3. The code is written in C in spite of it being 2014 at the time.
- rdc12 11y agoThe code is from an entry in the Underhanded C Contest, it is pretty much a given that the entries will be written in C.
- itistoday2 11y agoI am aware of that.
- deleted 11y ago[deleted]