aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/messenger_api_message.h
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2021-11-22 14:45:56 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2021-11-22 14:45:56 +0100
commitb57f92ee938794a862c93c3dcc5cd47f061c4cb4 (patch)
tree3b153dfe620ae4cf32ebaf9a1ffbf896ef8f7b8a /src/messenger/messenger_api_message.h
parent0bca602d06bfeeb961919d971d7d25d8010ab5f2 (diff)
downloadgnunet-b57f92ee938794a862c93c3dcc5cd47f061c4cb4.tar.gz
gnunet-b57f92ee938794a862c93c3dcc5cd47f061c4cb4.zip
-fixed problem of uninitialized memory by not using it
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/messenger/messenger_api_message.h')
-rw-r--r--src/messenger/messenger_api_message.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/messenger/messenger_api_message.h b/src/messenger/messenger_api_message.h
index 21161c134..46c5cb024 100644
--- a/src/messenger/messenger_api_message.h
+++ b/src/messenger/messenger_api_message.h
@@ -90,21 +90,23 @@ is_message_session_bound (const struct GNUNET_MESSENGER_Message *message);
90 * Returns the minimal size in bytes to encode a message of a specific <i>kind</i>. 90 * Returns the minimal size in bytes to encode a message of a specific <i>kind</i>.
91 * 91 *
92 * @param[in] kind Kind of message 92 * @param[in] kind Kind of message
93 * @param[in] include_header Flag to include header
93 * @return Minimal size to encode 94 * @return Minimal size to encode
94 */ 95 */
95uint16_t 96uint16_t
96get_message_kind_size (enum GNUNET_MESSENGER_MessageKind kind); 97get_message_kind_size (enum GNUNET_MESSENGER_MessageKind kind,
98 int include_header);
97 99
98/** 100/**
99 * Returns the exact size in bytes to encode a given <i>message</i>. 101 * Returns the exact size in bytes to encode a given <i>message</i>.
100 * 102 *
101 * @param[in] message Message 103 * @param[in] message Message
102 * @param[in] encode_signature Flag to include signature 104 * @param[in] include_header Flag to include header
103 * @return Size to encode 105 * @return Size to encode
104 */ 106 */
105uint16_t 107uint16_t
106get_message_size (const struct GNUNET_MESSENGER_Message *message, 108get_message_size (const struct GNUNET_MESSENGER_Message *message,
107 int include_signature); 109 int include_header);
108 110
109/** 111/**
110 * Encodes a given <i>message</i> into a <i>buffer</i> of a maximal <i>length</i> in bytes. 112 * Encodes a given <i>message</i> into a <i>buffer</i> of a maximal <i>length</i> in bytes.
@@ -112,13 +114,13 @@ get_message_size (const struct GNUNET_MESSENGER_Message *message,
112 * @param[in] message Message 114 * @param[in] message Message
113 * @param[in] length Maximal length to encode 115 * @param[in] length Maximal length to encode
114 * @param[out] buffer Buffer 116 * @param[out] buffer Buffer
115 * @param[in] encode_signature Flag to include signature 117 * @param[in] include_header Flag to include header
116 */ 118 */
117void 119void
118encode_message (const struct GNUNET_MESSENGER_Message *message, 120encode_message (const struct GNUNET_MESSENGER_Message *message,
119 uint16_t length, 121 uint16_t length,
120 char *buffer, 122 char *buffer,
121 int include_signature); 123 int include_header);
122 124
123/** 125/**
124 * Decodes a <i>message</i> from a given <i>buffer</i> of a maximal <i>length</i> in bytes. 126 * Decodes a <i>message</i> from a given <i>buffer</i> of a maximal <i>length</i> in bytes.
@@ -131,6 +133,7 @@ encode_message (const struct GNUNET_MESSENGER_Message *message,
131 * @param[out] message Message 133 * @param[out] message Message
132 * @param[in] length Maximal length to decode 134 * @param[in] length Maximal length to decode
133 * @param[in] buffer Buffer 135 * @param[in] buffer Buffer
136 * @param[in] include_header Flag to include header
134 * @param[out] padding Padding 137 * @param[out] padding Padding
135 * @return #GNUNET_YES on success, otherwise #GNUNET_NO 138 * @return #GNUNET_YES on success, otherwise #GNUNET_NO
136 */ 139 */
@@ -138,7 +141,7 @@ int
138decode_message (struct GNUNET_MESSENGER_Message *message, 141decode_message (struct GNUNET_MESSENGER_Message *message,
139 uint16_t length, 142 uint16_t length,
140 const char *buffer, 143 const char *buffer,
141 int include_signature, 144 int include_header,
142 uint16_t *padding); 145 uint16_t *padding);
143 146
144/** 147/**