Files @ r25360:c5efeb83c7e8
Branch filter:

Location: cpp/openttd-patchpack/source/regression/stationlist/result.txt - annotation

rubidium42
Fix: [Network] Reading beyond the length of the server's ID when hashing password

Under normal circumstances the server's ID is 32 characters excluding '\0', however this can be changed at the server. This ID is sent to the server for company name hashing. The client reads it into a statically allocated buffer of 33 bytes, but fills only the bytes it received from the server. However, the hash assumes all 33 bytes are set, thus potentially reading uninitialized data, or a part of the server ID of a previous game in the hashing routine.
It is still reading from memory assigned to the server ID, so nothing bad happens, except that company passwords might not work correctly.
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06
r24242:3697a2e18a06

--StationList--
  Count():             5
  Location ListDump:
    6 => 42341
    2 => 41831
    7 => 41825
    5 => 33421
    4 => 33411
  CargoWaiting(0) ListDump:
    7 => 6
    6 => 6
    2 => 3
    5 => 0
    4 => 0
  CargoWaiting(1) ListDump:
    7 => 0
    6 => 0
    5 => 0
    4 => 0
    2 => 0

--StationList_Cargo--
  0
    0
      6 => 6
    1
      6 => 2
    2
      2 => 4
      7 => 2
    3
  1
    0
      7 => 18
      6 => 16
      2 => 7
    1
      6 => 8
      2 => 3
    2
      2 => 16
      6 => 14
      7 => 11
    3
      6 => 10
      2 => 8

--StationList_CargoPlanned--
    0
      7 => 18
      6 => 16
      2 => 7
    1
      6 => 8
      2 => 3
    2
      2 => 16
      6 => 14
      7 => 11
    3
      6 => 10
      2 => 8

--StationList_CargoPlannedByFrom--
      7 => 8
      6 => 8
      2 => 7

--StationList_CargoPlannedByVia--
      2 => 16
      6 => 7

--StationList_CargoPlannedViaByFrom--
      6 => 8
      2 => 3

--StationList_CargoPlannedFromByVia--
      6 => 10
      2 => 8

--StationList_CargoWaiting--
    0
      6 => 6
    1
      6 => 2
    2
      2 => 4
      7 => 2
    3

--StationList_CargoWaitingByFrom--
      2 => 3

--StationList_CargoWaitingByVia--
      6 => 3

--StationList_CargoWaitingViaByFrom--
      6 => 2

--StationList_CargoWaitingFromByVia--
      6 => 3

--StationList_Vehicle--
  Count():             2
  Location ListDump:
    5 => 33421
    4 => 33411
  CargoWaiting(0) ListDump:
    5 => 0
    4 => 0
  CargoWaiting(1) ListDump:
    5 => 0
    4 => 0
  CargoRating(1) ListDump:
    5 => -1
    4 => -1
  DistanceManhattanToTile(30000) ListDump:
    5 => 106
    4 => 96
  DistanceSquareToTile(30000) ListDump:
    5 => 8818
    4 => 7058
  IsWithinTownInfluence(0) ListDump:
    5 => 0
    4 => 0
ERROR: The script died unexpectedly.