Hi developers,
I have a concern in avro version (avro-c-1.8.1) . while doing encoding, we
don't check for (return ENOMEM) from the internal APIs, in which the memory is
allocated to store the field.
void
avro_raw_string_set(avro_raw_string_t *str, const char *src)
{
size_t length = strlen(src);
avro_raw_string_ensure_buf(str, length+1);--->return value not checked.
memcpy((void *) str->wrapped.buf, src, length+1);
str->wrapped.size = length+1;
}
So in case there is a memory failure , the memcpy will still go ahead, and it
leads to crash.
How can we go about fixing this ? I saw the code in 1-9.0 as well, but saw the
same code in that release also.
Thanks
Aditya jain.