projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fff0bf
)
Packet engine: prevent divide by 0
author
Pekka Riikonen
<priikone@silcnet.org>
Tue, 11 May 2010 04:44:09 +0000
(07:44 +0300)
committer
Pekka Riikonen
<priikone@silcnet.org>
Tue, 11 May 2010 04:44:09 +0000
(07:44 +0300)
lib/silccore/silcpacket.c
patch
|
blob
|
history
diff --git
a/lib/silccore/silcpacket.c
b/lib/silccore/silcpacket.c
index 5ccf822fb16977c29274d82db3679be6883250f8..030291a09e83256bc389e02d32e85c48ed53d70c 100644
(file)
--- a/
lib/silccore/silcpacket.c
+++ b/
lib/silccore/silcpacket.c
@@
-2231,8
+2231,9
@@
static void silc_packet_read_process(SilcPacketStream stream)
/* Padding sanity checks */
if (cipher && silc_cipher_get_mode(cipher) != SILC_CIPHER_MODE_CTR &&
/* Padding sanity checks */
if (cipher && silc_cipher_get_mode(cipher) != SILC_CIPHER_MODE_CTR &&
- ((normal && paddedlen % block_len != 0) ||
- (!normal && silc_packet_special_len(header) % block_len != 0))) {
+ ((normal && block_len && paddedlen % block_len != 0) ||
+ (!normal && block_len &&
+ silc_packet_special_len(header) % block_len != 0))) {
SILC_LOG_DEBUG(("Packet length %d not multiple by cipher block length",
paddedlen));
silc_mutex_unlock(stream->lock);
SILC_LOG_DEBUG(("Packet length %d not multiple by cipher block length",
paddedlen));
silc_mutex_unlock(stream->lock);