autofs: fix segment fault on musl when running in debug mode.

This commit is contained in:
Enno Boland 2019-03-30 11:28:53 +01:00
parent ef108f37de
commit 4db519dcbf
No known key found for this signature in database
GPG key ID: D09964719BDE9971
2 changed files with 16 additions and 1 deletions

View file

@ -28,3 +28,18 @@
#include "automount.h"
#if defined(LIBXML2_WORKAROUND) || defined(TIRPC_WORKAROUND)
#include <dlfcn.h>
--- lib/log.c.orig 2019-03-30 10:49:52.965336128 +0100
+++ lib/log.c 2019-03-30 10:50:43.232710045 +0100
@@ -38,7 +38,11 @@ static char *prepare_attempt_prefix(cons
char buffer[ATTEMPT_ID_SIZE + 1];
char *prefixed_msg = NULL;
- attempt_id = pthread_getspecific(key_thread_attempt_id);
+ if (key_thread_attempt_id) {
+ attempt_id = pthread_getspecific(key_thread_attempt_id);
+ } else {
+ attempt_id = 0;
+ }
if (attempt_id) {
int len = sizeof(buffer) + 1 + strlen(msg) + 1;

View file

@ -1,7 +1,7 @@
# Template file for 'autofs'
pkgname=autofs
version=5.1.5
revision=2
revision=3
build_style=gnu-configure
make_build_args="DONTSTRIP=1"
configure_args="--with-libtirpc --with-mapdir=/etc/autofs --sbindir=/usr/bin"