I think here is a bug:

char *osmo_quote_str_c(const void *ctx, const char *str, int in_len)
{
        char *buf = talloc_size(ctx, OSMO_MAX(in_len+2, 32));
        if (!buf)
                return NULL;
        return osmo_quote_str_buf2(buf, 32, str, in_len);
}

We may allocate more than 32 bytes (see OSMO_MAX()) but still allow to write
only 32 bytes?

Looks like the allocated len should be stored in a local variable to pass to
osmo_quote_str_buf2().

And if I'm right, what is the 32 for? At least 32??

~N

Attachment: signature.asc
Description: PGP signature

Reply via email to