From 9f646e3a6db90aae19fa127ebbe5dd35464b3aa6 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Nov 06 2020 06:10:55 +0000 Subject: Apply patch autofs-5.1.4-add-NULL-check-in-prepare_attempt_prefix.patch patch_name: autofs-5.1.4-add-NULL-check-in-prepare_attempt_prefix.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index ac3659d..d39ce27 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -39,6 +39,7 @@ xx/xx/2018 autofs-5.1.5 - better handle hesiod support not built in. - fix hesiod string check in master_parse(). - remove autofs4 module load code. +- add NULL check in prepare_attempt_prefix(). 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/lib/log.c b/lib/log.c index f6ab77c..41f95fe 100644 --- a/lib/log.c +++ b/lib/log.c @@ -44,6 +44,8 @@ static char *prepare_attempt_prefix(const char *msg) snprintf(buffer, ATTEMPT_ID_SIZE, "%02lx", *attempt_id); prefixed_msg = (char *) calloc(len, sizeof(char)); + if (!prefixed_msg) + return NULL; strcpy(prefixed_msg, buffer); strcat(prefixed_msg, "|"); strcat(prefixed_msg, msg);