Changeset 11130 in ntrip for trunk/BNC/src/bncnetqueryrtp.cpp


Ignore:
Timestamp:
Oct 28, 2026, 9:32:30 AM (10 days ago)
Author:
stuerze
Message:

Some fixes from security point of view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncnetqueryrtp.cpp

    r11128 r11130  
    110110
    111111  const int timeOut = 5000;
     112  const int maxHeaderLines = 100; // of an RTSP answer
    112113
    113114  _status = running;
    … …  
    177178        QByteArray serverPort;
    178179        QString line = in.readLine();
    179         while (!line.isEmpty()) {
     180        int nLines = 0;
     181        while (!line.isEmpty() && ++nLines <= maxHeaderLines) {
    180182          if (line.indexOf("Session:") == 0) {
    181183            _session = line.mid(9).toLatin1();
    … …  
    226228              QTextStream in(_socket);
    227229              line = in.readLine();
    228               while (!line.isEmpty()) {
     230              nLines = 0;
     231              while (!line.isEmpty() && ++nLines <= maxHeaderLines) {
    229232                if (line.indexOf("200 OK") != -1) {
    230233                  emit newMessage(_url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"")
Note: See TracChangeset for help on using the changeset viewer.