sasl: Add missing length check
This could otherwise lead to an integer underflow on specially crafted input. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
1 parent
b42f57e1e0
commit
1dbdc4f37d
1 file changed
+5
@@ -145,6 +145,11 @@ public:
|
||||
data += size;
|
||||
|
||||
/* Server public key */
|
||||
if (length < 2) {
|
||||
DEBUG("sasl: No public key");
|
||||
return false;
|
||||
}
|
||||
|
||||
size = ntohs(*(uint16_t*)data);
|
||||
data += 2;
|
||||
length -= 2;
|
||||
|
||||
Reference in new issue
Block a user