subsurface/smtk-import
Salvador Cuñat e3a158624b smtk-import: Workaround segfault in mdbtools memcpy call
Smtk2ssrf has a segfault which matches quite well glibc's
CVE-2019-6488 (except for the x32 part).
It came from a call to memcpy in mdb_ole_read() func, used to get the
header and the profile of a dive from the database.
May be it could be fixed in libmdb but Mdbtools project has been stalled
for the past 5 years so ...

The segfault seems to be triggered by an empty profile in the first dive
in the database (a pretty common case in older Aladin DCs due to their
little memmory). The only special thing here is the fact it's the first
dive in the database structure (not the first by its index).

We can avoid the crash if we don't call mdb_ole_read_full() func on zero
sized profile field.

The problem here is we can't get the size of the fields and build the
MdbColumn in the same roud.  Happily we just need the MdbColumn struct
for the dive profile and header.  So, we can change the previous approach
using MdbColumns through almost all functions to a simpler one using the
already bounded strings by smtk_open_table() and just using the
col[n]->bind_pointer in the main function where the columns are built to
be used by mdb_ole_read_full().

Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2020-08-13 10:02:12 -07:00
..
cmake/Modules smtk-import: add cmake modules and .nsi skeleton 2017-06-11 13:50:30 -07:00
CMakeLists.txt build-system/MXE: build with more up to date MXE tools. 2020-06-25 11:00:51 -07:00
smartrak.c smtk-import: Workaround segfault in mdbtools memcpy call 2020-08-13 10:02:12 -07:00
smrtk2ssrfc_window.cpp Cleanup: move error reporting function declarations to errorhelper.h 2019-08-08 16:26:30 -07:00
smrtk2ssrfc_window.h Cleanup: make lastUsedDir() functions static and non-slot, respectively 2018-06-09 17:11:29 +02:00
smrtk2ssrfc_window.ui Use icons relative path. 2017-11-30 23:14:46 -08:00
smtk2ssrf.desktop smtk-import: Add smtk2ssrf.desktop to sources 2018-02-24 13:42:01 -08:00
smtk_standalone.cpp cleanup: move dive_table from dive.h to divelist.h 2020-05-01 09:42:31 -07:00