summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-13 21:21:58 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-13 23:42:17 -0400
commit0915fda60a12139db3d246da0c3d16c9ba127b4e (patch)
treedba896f7250de3da57942e509da25a6ea8065821 /src
parentd6483ba7834b9e63caee929c9d6373b796be1b21 (diff)
test-dhcp-option: add assert to check index is nonnegative
CID #1237623.
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-network/test-dhcp-option.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c
index 6062a37dab..bd448ff2b2 100644
--- a/src/libsystemd-network/test-dhcp-option.c
+++ b/src/libsystemd-network/test-dhcp-option.c
@@ -130,6 +130,8 @@ static DHCPMessage *create_message(uint8_t *options, uint16_t optlen,
static void test_ignore_opts(uint8_t *descoption, int *descpos, int *desclen)
{
+ assert(*descpos >= 0);
+
while (*descpos < *desclen) {
switch(descoption[*descpos]) {
case DHCP_OPTION_PAD: