From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8551 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Results of static analysis with clang static analyser Date: Wed, 23 Sep 2015 22:11:32 +0200 Message-ID: <20150923201131.GF10551@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="kfjH4zxOES6UT95V" X-Trace: ger.gmane.org 1443039112 6946 80.91.229.3 (23 Sep 2015 20:11:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2015 20:11:52 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8563-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 23 22:11:52 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZeqOJ-0001ui-1P for gllmg-musl@m.gmane.org; Wed, 23 Sep 2015 22:11:47 +0200 Original-Received: (qmail 7501 invoked by uid 550); 23 Sep 2015 20:11:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7482 invoked from network); 23 Sep 2015 20:11:44 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:8551 Archived-At: --kfjH4zxOES6UT95V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Khem Raj [2015-09-22 22:58:55 -0700]: > I have run scan-build on musl-git and here are results > > http://busybox.net/~kraj/scan-build-2015-09-22-224330-15962-1/ > http://busybox.net/~kraj/scan-build-2015-09-22-224330-15962-1/report-321c4e.html#EndPath this one is real, status can be REG_ESPACE (meaning oom). the rest seem ok or benign. --kfjH4zxOES6UT95V Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-regcomp-propagate-allocation-failures.patch" >From 321c6a26fade377642664c7a2f6a6f2999266ce1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 23 Sep 2015 18:19:34 +0000 Subject: [PATCH] regcomp: propagate allocation failures The error code of an allocating function was not checked in tre_add_tag. --- src/regex/regcomp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index 978dd87..330de46 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -1584,7 +1584,8 @@ tre_add_tags(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree, { status = tre_add_tag_right(mem, left, tag_left); tnfa->tag_directions[tag_left] = TRE_TAG_MAXIMIZE; - status = tre_add_tag_right(mem, right, tag_right); + if (status == REG_OK) + status = tre_add_tag_right(mem, right, tag_right); tnfa->tag_directions[tag_right] = TRE_TAG_MAXIMIZE; } num_tags += 2; -- 2.4.1 --kfjH4zxOES6UT95V--