chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test-dhcp-option: add assert to check index is nonnegative
[elogind.git]
/
src
/
libsystemd-network
/
test-dhcp-option.c
diff --git
a/src/libsystemd-network/test-dhcp-option.c
b/src/libsystemd-network/test-dhcp-option.c
index 6062a37dabc376631cdb984f8b61e6efd39e730b..bd448ff2b20dc868056d8c0378f9f146a5a1adef 100644
(file)
--- 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)
{
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:
while (*descpos < *desclen) {
switch(descoption[*descpos]) {
case DHCP_OPTION_PAD: