From: Michal Bloch Date: Wed, 27 Mar 2024 11:12:05 +0000 (+0100) Subject: Fix a null dereference issue X-Git-Tag: accepted/tizen/unified/toolchain/20240610.173225~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0d09aed80d7f055f78b7b087f6d41f06fe8caaf;p=platform%2Fkernel%2Flinux-tizen-modules-source.git Fix a null dereference issue Change-Id: I50fe239a1590740e8c15a6a1499baf894c7cbdd9 --- diff --git a/tests/logger/logger.c b/tests/logger/logger.c index b7c7b72..d2c4231 100644 --- a/tests/logger/logger.c +++ b/tests/logger/logger.c @@ -285,12 +285,20 @@ int main(int ac, char *av[]) { break; case 't': tag = strdup(optarg); + if (!tag) { + fprintf(stderr, "not enough memory!\n"); + exit(EXIT_FAILURE); + } break; case 'm': test_mask = (unsigned long) strtol(optarg, NULL, 16); break; case 'd': device = strdup(optarg); + if (!device) { + fprintf(stderr, "not enough memory!\n"); + exit(EXIT_FAILURE); + } break; case 'D': dump = true;