From c4fc4676a1cefcbffffe05c95907866b25416124 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 6 May 2007 20:03:23 +0000 Subject: [PATCH] Fixed silc_message_payload_free crash. Added SILC_STATUS_ERR_NO_SUCH_PUBLIC_KEY. --- lib/silccore/silcmessage.c | 2 +- lib/silccore/silcstatus.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/silccore/silcmessage.c b/lib/silccore/silcmessage.c index ae257eb2..d1b43ee5 100644 --- a/lib/silccore/silcmessage.c +++ b/lib/silccore/silcmessage.c @@ -671,6 +671,7 @@ SilcBuffer silc_message_payload_encode(SilcMessageFlags flags, void silc_message_payload_free(SilcMessagePayload payload) { + silc_message_signed_payload_free(&payload->sig); if (payload->data) { memset(payload->data, 0, payload->data_len); if (payload->allocated) @@ -680,7 +681,6 @@ void silc_message_payload_free(SilcMessagePayload payload) silc_free(payload->pad); silc_free(payload); } - silc_message_signed_payload_free(&payload->sig); } /* Return flags */ diff --git a/lib/silccore/silcstatus.h b/lib/silccore/silcstatus.h index 3f1637b6..4eba1742 100644 --- a/lib/silccore/silcstatus.h +++ b/lib/silccore/silcstatus.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 2002 - 2005 Pekka Riikonen + Copyright (C) 2002 - 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -104,6 +104,7 @@ typedef SilcUInt8 SilcStatus; #define SILC_STATUS_ERR_OPERATION_ALLOWED 56 #define SILC_STATUS_ERR_BAD_SERVER 57 #define SILC_STATUS_ERR_BAD_USERNAME 58 +#define SILC_STATUS_ERR_NO_SUCH_PUBLIC_KEY 59 /***/ #define SILC_STATUS_IS_ERROR(status) (status >= SILC_STATUS_ERR_NO_SUCH_NICK) -- 2.24.0