summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2014-09-08 10:30:03 -0400
committerThomas Markwalder <tmark@isc.org>2014-09-08 10:30:03 -0400
commit1fdd3f00e44c70094047a1f629ebd7215b196023 (patch)
treeecb354c7c6affc814f0529d22142f35162a7a90f
parentc43b6da124ded67c9c02f32e3939b57ab87c4fd5 (diff)
downloadisc-dhcp-1fdd3f00e44c70094047a1f629ebd7215b196023.tar.gz
[v4_2] Added check for invalid failover message type.
Merges in rt36653
-rw-r--r--RELNOTES3
-rw-r--r--includes/failover.h2
-rw-r--r--server/failover.c6
3 files changed, 11 insertions, 0 deletions
diff --git a/RELNOTES b/RELNOTES
index d685304c..00f56e55 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -45,6 +45,9 @@ by Eric Young (eay@cryptsoft.com).
Changes since 4.2.7
+- Added check for invalid failover message type.
+ [ISC-Bugs #36653]
+
- Corrected rate limiting checks for bad packet logging.
[ISC-Bugs #36897]
diff --git a/includes/failover.h b/includes/failover.h
index 090daee5..b49c2418 100644
--- a/includes/failover.h
+++ b/includes/failover.h
@@ -161,6 +161,8 @@ typedef struct {
#define FTM_CONTACT 11
#define FTM_DISCONNECT 12
+#define FTM_MAX FTM_DISCONNECT
+
/* Reject reasons from Section 12.21: */
#define FTR_ILLEGAL_IP_ADDR 1
#define FTR_FATAL_CONFLICT 2
diff --git a/server/failover.c b/server/failover.c
index 75fc8553..b24c5aaf 100644
--- a/server/failover.c
+++ b/server/failover.c
@@ -626,6 +626,12 @@ static isc_result_t do_a_failover_option (c, link)
return DHCP_R_PROTOCOLERROR;
}
+ if (link->imsg->type > FTM_MAX) {
+ log_error ("FAILOVER: invalid message type: %d",
+ link->imsg->type);
+ return DHCP_R_PROTOCOLERROR;
+ }
+
/* Get option code. */
omapi_connection_get_uint16 (c, &option_code);
link -> imsg_count += 2;