1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

psyc_render_list: check validity of inputs

This commit is contained in:
psyc://loupsycedyglgamf.onion/~lynX 2017-01-05 21:51:39 +00:00
parent 4d0d0bb9b6
commit 8fe9264b7e

View file

@ -85,9 +85,11 @@ psyc_render_list (PsycList *list, char *buffer, size_t buflen)
{
size_t i, cur = 0;
ASSERT(NULL != list);
if (list->length > buflen) // return error if list doesn't fit in buffer
return PSYC_RENDER_ERROR;
ASSERT(NULL != buffer);
if (list->type.length) {
memcpy(buffer + cur, PSYC_S2ARG(list->type));
cur += list->type.length;