mirror of
https://github.com/RangeNetworks/openbts.git
synced 2025-10-22 23:32:00 +00:00
transceiver: Use length fields in UDP receive calls
Update to match socket changes for buffer underrun prevention in CommonLibs patch "common: Add mandatory length field to UDP receive calls" Reported-by: Simone Margaritelli <simone@zimperium.com> Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
This commit is contained in:
@@ -470,7 +470,7 @@ void Transceiver::driveControl()
|
||||
int msgLen = -1;
|
||||
buffer[0] = '\0';
|
||||
|
||||
msgLen = mControlSocket.read(buffer);
|
||||
msgLen = mControlSocket.read(buffer, sizeof(buffer));
|
||||
|
||||
if (msgLen < 1) {
|
||||
return;
|
||||
@@ -661,7 +661,7 @@ bool Transceiver::driveTransmitPriorityQueue()
|
||||
char buffer[gSlotLen+50];
|
||||
|
||||
// check data socket
|
||||
size_t msgLen = mDataSocket.read(buffer);
|
||||
size_t msgLen = mDataSocket.read(buffer, sizeof(buffer));
|
||||
|
||||
if (msgLen!=gSlotLen+1+4+1) {
|
||||
LOG(ERR) << "badly formatted packet on GSM->TRX interface";
|
||||
|
@@ -463,7 +463,7 @@ void Transceiver::driveControl(unsigned ARFCN)
|
||||
int msgLen = -1;
|
||||
buffer[0] = '\0';
|
||||
|
||||
msgLen = mControlSocket[ARFCN]->read(buffer);
|
||||
msgLen = mControlSocket[ARFCN]->read(buffer, sizeof(buffer));
|
||||
|
||||
mControlLock.lock();
|
||||
|
||||
@@ -725,7 +725,7 @@ bool Transceiver::driveTransmitPriorityQueue(unsigned ARFCN)
|
||||
char buffer[gSlotLen+50];
|
||||
|
||||
// check data socket
|
||||
size_t msgLen = mDataSocket[ARFCN]->read(buffer);
|
||||
size_t msgLen = mDataSocket[ARFCN]->read(buffer, sizeof(buffer));
|
||||
|
||||
ScopedLock lock(mTransmitPriorityQueueLock);
|
||||
|
||||
|
Reference in New Issue
Block a user