if (ret == -1)
goto err;
+ if (newp->type > SILC_ID_CHANNEL)
+ goto err;
+
silc_buffer_pull(&buffer, 4);
if (newp->len > buffer.len || newp->len > SILC_PACKET_MAX_ID_LEN)
if (ret == -1)
return NULL;
+ if (type > SILC_ID_CHANNEL)
+ return NULL;
+
silc_buffer_pull(&buffer, 4);
if (idlen > buffer.len || idlen > SILC_PACKET_MAX_ID_LEN)
SilcChannelID *channel_id;
SilcUInt32 id_len = silc_id_get_len(id, type);
+ if (id_len > SILC_PACKET_MAX_ID_LEN)
+ return NULL;
+
switch(type) {
case SILC_ID_SERVER:
server_id = (SilcServerID *)id;
void *silc_id_str2id(const unsigned char *id, SilcUInt32 id_len,
SilcIdType type)
{
+ if (id_len > SILC_PACKET_MAX_ID_LEN)
+ return NULL;
switch(type) {
case SILC_ID_SERVER: