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

Some fixes from security point of view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r11124 r11130  
    3939 * -----------------------------------------------------------------------*/
    4040
     41#include <atomic>
    4142#include <iostream>
    4243#include <iomanip>
    … …  
    241242/**
    242243 * Frequency numbers of GLONASS with an offset of 100 to detect unset values.
    243  * Gets filled by ephemeris and data blocks and shared between different streams.
     244 * Gets filled by ephemeris and data blocks and shared between different streams
     245 * (MSM4/6 streams without channel numbers use those of an ephemeris stream).
     246 * Atomic, as the streams are decoded in different threads.
    244247 */
    245 static int GLOFreq[RTCM3_MSM_NUMSAT];
     248static std::atomic<int> GLOFreq[RTCM3_MSM_NUMSAT];
    246249
    247250/*
    … …  
    19982001  GETSTRING(antnum, antenna)
    19992002  if ((antnum > -1 && antnum < 265) &&
    2000       (_antType.empty() || strncmp(_antType.back()._descriptor, antenna, recnum) != 0)) {
     2003      (_antType.empty() || int(strlen(_antType.back()._descriptor)) != antnum ||
     2004       strncmp(_antType.back()._descriptor, antenna, antnum) != 0)) {
    20012005    _antType.push_back(t_antInfo());
    20022006    memcpy(_antType.back()._descriptor, antenna, antnum);
    … …  
    20172021    GETSTRING(recsernum, recserialnum)
    20182022    if ((recnum > -1 && recnum < 265) &&
    2019         (_recType.empty() || strncmp(_recType.back()._descriptor, receiver, recnum) != 0)) {
     2023        (_recType.empty() || int(strlen(_recType.back()._descriptor)) != recnum ||
     2024         strncmp(_recType.back()._descriptor, receiver, recnum) != 0)) {
    20202025      _recType.push_back(t_recInfo());
    20212026      memcpy(_recType.back()._descriptor, receiver, recnum);
Note: See TracChangeset for help on using the changeset viewer.