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:
parent
4d0d0bb9b6
commit
8fe9264b7e
1 changed files with 2 additions and 0 deletions
|
@ -85,9 +85,11 @@ psyc_render_list (PsycList *list, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
size_t i, cur = 0;
|
size_t i, cur = 0;
|
||||||
|
|
||||||
|
ASSERT(NULL != list);
|
||||||
if (list->length > buflen) // return error if list doesn't fit in buffer
|
if (list->length > buflen) // return error if list doesn't fit in buffer
|
||||||
return PSYC_RENDER_ERROR;
|
return PSYC_RENDER_ERROR;
|
||||||
|
|
||||||
|
ASSERT(NULL != buffer);
|
||||||
if (list->type.length) {
|
if (list->type.length) {
|
||||||
memcpy(buffer + cur, PSYC_S2ARG(list->type));
|
memcpy(buffer + cur, PSYC_S2ARG(list->type));
|
||||||
cur += list->type.length;
|
cur += list->type.length;
|
||||||
|
|
Loading…
Reference in a new issue