X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccore%2Fsilcnotify.c;h=d1e739b18e2862f1b18310174b796dde5610bda6;hb=48d89bc2868ec49c2ab9aa74efe9ac703eee8f29;hp=f786f094b121d9f21765b6204e35397f1326d5db;hpb=10ec50cff8ad9d6a77080821037c1234dc066b47;p=silc.git diff --git a/lib/silccore/silcnotify.c b/lib/silccore/silcnotify.c index f786f094..d1e739b1 100644 --- a/lib/silccore/silcnotify.c +++ b/lib/silccore/silcnotify.c @@ -40,16 +40,19 @@ SilcNotifyPayload silc_notify_payload_parse(SilcBuffer buffer) { SilcNotifyPayload new; unsigned short len; + int ret; SILC_LOG_DEBUG(("Parsing Notify payload")); new = silc_calloc(1, sizeof(*new)); - silc_buffer_unformat(buffer, - SILC_STR_UI_SHORT(&new->type), - SILC_STR_UI_SHORT(&len), - SILC_STR_UI_CHAR(&new->argc), - SILC_STR_END); + ret = silc_buffer_unformat(buffer, + SILC_STR_UI_SHORT(&new->type), + SILC_STR_UI_SHORT(&len), + SILC_STR_UI_CHAR(&new->argc), + SILC_STR_END); + if (ret == -1) + goto err; if (len > buffer->len) goto err;