Clean 'make check' against gcc -fsanitize=address,undefined
Julien ÉLIE
julien at trigofacile.com
Mon Jun 22 18:27:58 UTC 2015
Hi Richard,
> Patch attached.
OK, thanks for these.
> --- a/tests/innd/artparse-t.c
> +++ b/tests/innd/artparse-t.c
> @@ -59,6 +59,7 @@ fake_innconf(void)
> free(innconf);
> }
> innconf = xmalloc(sizeof(*innconf));
> + memset(innconf, 0, sizeof *innconf);
> innconf->logipaddr = false;
> innconf->maxartsize = 8 * 1024;
> innconf->pathetc = xstrdup("../data/etc");
Shouldn't the same memset() line be added after the allocation
of innconf in the following files?
- tests/overview/api-t.c
- tests/overview/overview-t.c
- tests/overview/xref-t.c
- lib/innconf.c
"-fsanitize=address,undefined" did not trigger any warning for them?
> 1. memchr can't tolerate a null pointer argument (even for 0 bytes)
>
> --- a/lib/buffer.c
> +++ b/lib/buffer.c
> @@ -245,6 +245,8 @@ buffer_find_string(struct buffer *buffer, const char *string, size_t start,
> length = strlen(string);
> do {
> data = buffer->data + buffer->used + start;
> + if(!data)
> + return false;
> terminator = memchr(data, string[0], buffer->left - start);
> if (terminator == NULL)
> return false;
This patch is related to an external library we use (rra-c-util). It will
be merged into INN when and if Russ takes it into account in a future release
of rra-c-util.
--
Julien ÉLIE
« Depuis que j'ai changé mon clavier qwerty pour un clavier azerty,
je tape deux fois plus vite.
Pourquoi ? Parce qu'un homme azerty en vaut deux ! »
More information about the inn-workers
mailing list