Commit 536a74fb authored by Nigel Kukard's avatar Nigel Kukard

We need at least 4 bytes len, else throw Exception

Change-Id: If27513b09adafc1fa1a05ea7295c92b91d097367
parent 7d615d41
......@@ -58,7 +58,6 @@ class Net_EPP_Protocol {
throw new exception('Timeout while reading from EPP Server');
}
}
// Check for timeout
if ($info['timed_out']) {
throw new Exception('Timeout while reading data from socket');
......@@ -115,6 +114,9 @@ class Net_EPP_Protocol {
static function getFrame($socket) {
// Read header
$hdr = Net_EPP_Protocol::_fread_nb($socket,4);
if (strlen($hdr) < 4) {
throw new Exception(sprintf('Short read of %d bytes from peer', strlen($hdr)));
}
// Unpack first 4 bytes which is our length
$unpacked = unpack('N', $hdr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment