diff options
author | 2019-06-02 10:19:30 +0300 | |
---|---|---|
committer | 2019-06-02 10:19:30 +0300 | |
commit | 44c82412b922847e0a3b3babb86158ffda5ebcf8 (patch) | |
tree | 836fb88ac8e3a8148e6081bf2e33379407268443 /src/common | |
parent | 227a0e12ee262dbabdd8d988fec194273cf90029 (diff) | |
download | usurpation-44c82412b922847e0a3b3babb86158ffda5ebcf8.tar.gz usurpation-44c82412b922847e0a3b3babb86158ffda5ebcf8.tar.bz2 usurpation-44c82412b922847e0a3b3babb86158ffda5ebcf8.zip |
Protocol: fixed a critical bug.
Look at the diff and it will be obvious what was fixed.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/tlv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/tlv.c b/src/common/tlv.c index c25f008..5b5ca5e 100644 --- a/src/common/tlv.c +++ b/src/common/tlv.c @@ -41,7 +41,7 @@ int tlv_get(struct tlv_parser *parser, struct tlv *ret) retval = END_OF_PACKET; } else { memcpy(&ret->type, parser->data + parser->offset, sizeof(ret->type)); - parser->size += sizeof(ret->type); + parser->offset += sizeof(ret->type); ret->length = memcpy(&ret->length, parser->data + parser->offset, sizeof(ret->length)); parser->offset += sizeof(ret->length); if (parser->offset + ret->length >= parser->size) { |