nathanel23 f65599e216 Fix for memory corruption/crash related to rhash
This patch fixes issues with some calls to the rhash C library that
cause subtle memory corruptions. There are two main issues that this
patch addresses:

1) The library init function is called multiple times in various places
within in the Util class. This is not necessary and may cause issues
if the initialization is repeated simultaneously in multiple threads.
Therefore the call was moved to the beginning of the main() function.

2) There is not enough space in the output buffers to store the
terminating NUL character of the hex-formatted hashes. The print
function from the rhash library writes a regular C string to
the output buffer and expects enough space to include the end
marker.

Depending on the memory layout generated by the compiler, this results
in one byte of the stack to be overwritten, which might lead to random
issues that are hard to find. On AArch64 (ARM) with GCC 6.3 the call to
the rhash_print() function happens to destroy the lower byte of the
frame pointer and causes a crash due to an invalid free() operation some
time after the Util::createXML function returned.
2019-01-06 01:06:23 +01:00
2016-05-20 20:33:07 +03:00
2016-01-17 18:15:12 +02:00
2018-09-15 15:22:19 +03:00
2013-03-15 22:46:16 +02:00

GOG Downloader

This repository contains the code of unofficial GOG downloader.

Dependencies

Make dependencies

Debian/Ubuntu

# apt install build-essential libcurl4-openssl-dev libboost-regex-dev \
libjsoncpp-dev liboauth-dev librhash-dev libtinyxml2-dev libhtmlcxx-dev \
libboost-system-dev libboost-filesystem-dev libboost-program-options-dev \
libboost-date-time-dev libboost-iostreams-dev help2man cmake libssl-dev \
pkg-config zlib1g-dev

Build and install

$ mkdir build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
$ make
# sudo make install

Use

man lgogdownloader
Description
LGOGDownloader is unofficial downloader to GOG.com for Linux users. It uses the same API as the official GOG Galaxy.
Readme 1.8 MiB
Languages
C++ 98.4%
CMake 1.6%