Bug#970520: wesnoth: Crash on starting wesnoth - stack smash detected

Gerardo Esteban Malazdrewicz gerardo at malazdrewicz.com.ar
Sun Nov 15 21:09:25 GMT 2020


Package: wesnoth
Version: 1:1.14.13-1
Followup-For: Bug #970520
X-Debbugs-Cc: gerardo at malazdrewicz.com.ar

Dear Maintainer,

Patch 99wolfssl-options attached adding

#include <wolfssl/options.h>

to affected files:

src/build_info.cpp
src/hash.cpp
src/preferences/credentials.cpp
src/server/user_handler.cpp

This causes a FTBFS, as MD5_DIGEST_SIZE is not defined.
Patch 99wolfssl-digest_size attached to fix that.
I chose to change the definitions to use WC_ (WolfCrypt) names,

#undef NO_OLD_WC_NAMES
#include <wolfcrypt/md5.h>

may be an alternative to define MD5_DIGEST_SIZE.

This works for wesnoth-1.15 too, changing

src/server/user_handler.cpp

with

src/server/common/user_handler.cpp

Order of application:
99wolfssl-options
99wolfssl-digest_size

Regards,
     Gerardo



-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.9.0-2-amd64 (SMP w/20 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages wesnoth depends on:
pn  wesnoth-1.14       <none>
pn  wesnoth-1.14-data  <none>

wesnoth recommends no packages.

wesnoth suggests no packages.
-------------- next part --------------
--- a/src/build_info.cpp	2020-11-15 11:28:28.184004892 -0400
+++ b/src/build_info.cpp	2020-11-15 11:28:15.393204807 -0400
@@ -37,6 +37,7 @@
 #include <boost/version.hpp>
 
 #ifndef __APPLE__
+#include <wolfssl/options.h>
 #include <openssl/crypto.h>
 #include <openssl/opensslv.h>
 #endif
--- a/src/hash.cpp	2020-11-15 11:07:42.000000000 -0400
+++ b/src/hash.cpp	2020-11-15 11:46:12.599349726 -0400
@@ -24,6 +24,7 @@
 
 #ifndef __APPLE__
 
+#include <wolfssl/options.h>
 #include <openssl/sha.h>
 #include <openssl/md5.h>
 
--- a/src/preferences/credentials.cpp	2020-10-17 01:40:02.000000000 -0300
+++ b/src/preferences/credentials.cpp	2020-11-15 11:25:23.984187330 -0400
@@ -25,6 +25,7 @@
 #include <memory>
 
 #ifndef __APPLE__
+#include <wolfssl/options.h>
 #include <openssl/rc4.h>
 #else
 #include <CommonCrypto/CommonCryptor.h>
--- a/src/server/user_handler.cpp	2020-10-17 01:40:02.000000000 -0300
+++ b/src/server/user_handler.cpp	2020-11-15 11:31:42.292524853 -0400
@@ -18,6 +18,7 @@
 #include "serialization/base64.hpp"
 
 #ifndef __APPLE__
+#include <wolfssl/options.h>
 #include <openssl/rand.h>
 #else
 #include <cstdlib>
-------------- next part --------------
--- a/src/hash.cpp	2020-11-15 12:19:19.000000000 -0400
+++ b/src/hash.cpp	2020-11-15 12:20:20.604391108 -0400
@@ -28,8 +28,8 @@
 #include <openssl/sha.h>
 #include <openssl/md5.h>
 
-static_assert(utils::md5::DIGEST_SIZE == MD5_DIGEST_LENGTH, "Constants mismatch");
-static_assert(utils::sha1::DIGEST_SIZE == SHA_DIGEST_LENGTH, "Constants mismatch");
+static_assert(utils::md5::DIGEST_SIZE == WC_MD5_DIGEST_SIZE, "Constants mismatch");
+static_assert(utils::sha1::DIGEST_SIZE == WC_SHA_DIGEST_SIZE, "Constants mismatch");
 
 #else
 


More information about the Pkg-games-devel mailing list