X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccore%2Fsilcmode.c;h=a937e365f4bf0b35e415abc323090b13ebaf63fd;hb=48d89bc2868ec49c2ab9aa74efe9ac703eee8f29;hp=2f04492ebbcd2a055163a94355d9eb0fcf7ff4d3;hpb=10ec50cff8ad9d6a77080821037c1234dc066b47;p=silc.git diff --git a/lib/silccore/silcmode.c b/lib/silccore/silcmode.c index 2f04492e..a937e365 100644 --- a/lib/silccore/silcmode.c +++ b/lib/silccore/silcmode.c @@ -41,17 +41,20 @@ SilcSetModePayload silc_set_mode_payload_parse(SilcBuffer buffer) { SilcSetModePayload new; unsigned short len; + int ret; SILC_LOG_DEBUG(("Parsing Set Mode payload")); new = silc_calloc(1, sizeof(*new)); - silc_buffer_unformat(buffer, - SILC_STR_UI_SHORT(&new->mode_type), - SILC_STR_UI_SHORT(&len), - SILC_STR_UI_INT(&new->mode_mask), - SILC_STR_UI_CHAR(&new->argc), - SILC_STR_END); + ret = silc_buffer_unformat(buffer, + SILC_STR_UI_SHORT(&new->mode_type), + SILC_STR_UI_SHORT(&len), + SILC_STR_UI_INT(&new->mode_mask), + SILC_STR_UI_CHAR(&new->argc), + SILC_STR_END); + if (ret == -1) + goto err; if (len > buffer->len) goto err;