CSECA-07020 - Buffer overflow in herror_new()

The formatted error message is copied into a fixed size buffer. Messages that format to a length of more than 249 will cause the buffer to overflow.

Example Code

#include <yoctohttp/common.h>

#include <stdio.h>

int main() {
        herror_t *err;

        err = herror_new("func", 0, "Oh Noes");
        printf("'%s'\n", herror_func(err));
        herror_release(err);

        err = herror_new("func", 0, "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789MyFunc");
        printf("'%s'\n", herror_func(err));     /* Should print "func", but actually prints "MyFunc" */
        herror_release(err);

        return 0;
}