[Scummvm-tracker] [ScummVM] #10342: SCUMM: UB & type system undermining in save/load code

Colin Snover trac at scummvm.org
Tue Nov 28 19:21:28 CET 2017


#10342: SCUMM: UB & type system undermining in save/load code
--------------------+---------------------------
Reporter:  csnover  |      Owner:  (none)
    Type:  defect   |     Status:  new
Priority:  normal   |  Component:  Engine: SCUMM
Keywords:           |       Game:
--------------------+---------------------------
 The SCUMM engine save/load code triggers UB by trying to get the offsets
 of non-POD members, and subverts the type system by casting to `void *`
 during serialisation. Already I found one bug in SCUMM HE where a
 `SpriteInfo**` was being treated as `SpriteInfo*` for game versions < 64,
 and this was compiling even though it is wrong because it was getting
 passed into a parameter of type `void *`. So all this needs to be fixed to
 use the `Common::Serializer` and to stop using `void *`.

--
Ticket URL: <https://bugs.scummvm.org/ticket/10342>
ScummVM <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list