mirror of
https://git.freebsd.org/ports.git
synced 2025-06-16 02:00:30 -04:00
- Fix build on aarch64 [1] - Remove ${name}_limits for 11-STABLE [2] PR: 227628 [1], 227434 [2], 228148 [3] Submitted by: Naram Qashat <cyberbotx cyberbotx com> [1] Submitted by: 0mp [2] Reported by: Miroslav Lachman <000 fbsd quip cz> [3] MFH: 2018Q2 Security: 57aec168-453e-11e8-8777-b499baebfeaf
46 lines
920 B
Text
46 lines
920 B
Text
--- mysys/stacktrace.c.orig 2018-03-26 14:18:03 UTC
|
|
+++ mysys/stacktrace.c
|
|
@@ -34,19 +34,19 @@
|
|
#include <execinfo.h>
|
|
#endif
|
|
|
|
+#ifdef __linux__
|
|
#define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end)
|
|
-
|
|
static char *heap_start;
|
|
-
|
|
-#ifdef HAVE_BSS_START
|
|
extern char *__bss_start;
|
|
-#endif
|
|
+#else
|
|
+#define PTR_SANE(p) (p)
|
|
+#endif /* __linux */
|
|
|
|
void my_init_stacktrace()
|
|
{
|
|
-#ifdef HAVE_BSS_START
|
|
+#ifdef __linux__
|
|
heap_start = (char*) &__bss_start;
|
|
-#endif
|
|
+#endif /* __linux__ */
|
|
}
|
|
|
|
#ifdef __linux__
|
|
@@ -149,15 +149,15 @@ static int safe_print_str(const char *ad
|
|
|
|
int my_safe_print_str(const char* val, int max_len)
|
|
{
|
|
+#ifdef __linux__
|
|
char *heap_end;
|
|
|
|
-#ifdef __linux__
|
|
// Try and make use of /proc filesystem to safely print memory contents.
|
|
if (!safe_print_str(val, max_len))
|
|
return 0;
|
|
-#endif
|
|
|
|
heap_end= (char*) sbrk(0);
|
|
+#endif
|
|
|
|
if (!PTR_SANE(val))
|
|
{
|