From 0e73bb797f63a1d72cc528746af70339ced90d7d Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 28 Oct 2014 09:07:40 +0100 Subject: [PATCH] shared/hfp: Fix possible NULL pointer dereference Fix missing check if malloc succed. --- src/shared/hfp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/hfp.c b/src/shared/hfp.c index eb6bf4e83..22e96224b 100644 --- a/src/shared/hfp.c +++ b/src/shared/hfp.c @@ -1098,6 +1098,8 @@ static void hf_process_input(struct hfp_hf *hfp) *ptr = '\0'; tmp = malloc(len + count); + if (!tmp) + goto done; /* "str" here is not a string so we need to use memcpy */ memcpy(tmp, str, len); -- 2.47.3