aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r--src/fuzzy_storage.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index b8e3d49c2..f806cb87d 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1249,7 +1249,6 @@ rspamd_fuzzy_extensions_from_wire (struct fuzzy_session *s, guchar *buf, gsize b
}
else if (cmd == RSPAMD_FUZZY_EXT_SOURCE_IP4) {
if (end - p >= sizeof (in_addr_t)) {
- p += sizeof (in_addr_t);
n_ext ++;
st_len += sizeof (in_addr_t);
}
@@ -1262,7 +1261,6 @@ rspamd_fuzzy_extensions_from_wire (struct fuzzy_session *s, guchar *buf, gsize b
}
else if (cmd == RSPAMD_FUZZY_EXT_SOURCE_IP6) {
if (end - p >= sizeof (struct in6_addr)) {
- p += sizeof (struct in6_addr);
n_ext ++;
st_len += sizeof (struct in6_addr);
}
@@ -1273,6 +1271,10 @@ rspamd_fuzzy_extensions_from_wire (struct fuzzy_session *s, guchar *buf, gsize b
p += sizeof (struct in6_addr);
}
+ else {
+ /* Invalid command */
+ return FALSE;
+ }
}
else {
/* Truncated extension */
@@ -1336,6 +1338,9 @@ rspamd_fuzzy_extensions_from_wire (struct fuzzy_session *s, guchar *buf, gsize b
data_buf += sizeof (struct in6_addr);
ext = ext->next;
}
+ else {
+ g_assert_not_reached ();
+ }
}
/* Last next should be NULL */