Skip to content

Commit

Permalink
app-doc/doxygen: Avoid dereferencing NULL pointer
Browse files Browse the repository at this point in the history
Gentoo-bug: 607160
* Thank you to Jiri Netolicky for finding the
  upstream issue and the commit that fixed it.

Package-Manager: Portage-2.3.3, Repoman-2.3.1
  • Loading branch information
SoapGentoo committed Feb 4, 2017
1 parent 12b6425 commit 6e7bb68
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ RESTRICT="test"
PATCHES=(
"${FILESDIR}/${PN}-1.8.9.1-empty-line-sigsegv.patch" #454348
"${FILESDIR}/${PN}-1.8.12-link_with_pthread.patch"
"${FILESDIR}/${PN}-1.8.13-NULL-dereference.patch"
)

DOCS=( LANGUAGE.HOWTO README.md )
Expand All @@ -64,7 +65,7 @@ pkg_setup() {
}

src_prepare() {
default
cmake-utils_src_prepare

# Ensure we link to -liconv
if use elibc_FreeBSD && has_version dev-libs/libiconv || use elibc_uclibc; then
Expand All @@ -82,12 +83,13 @@ src_prepare() {
doc/maintainers.txt || die

if is-flagq "-O3" ; then
echo
ewarn
ewarn "Compiling with -O3 is known to produce incorrectly"
ewarn "optimized code which breaks doxygen."
echo
ewarn
elog
elog "Continuing with -O2 instead ..."
echo
elog
replace-flags "-O3" "-O2"
fi
}
Expand Down
24 changes: 24 additions & 0 deletions app-doc/doxygen/files/doxygen-1.8.13-NULL-dereference.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 0f02761a158a5e9ddbd5801682482af8986dbc35 Mon Sep 17 00:00:00 2001
From: albert-github <[email protected]>
Date: Wed, 4 Jan 2017 12:24:55 +0100
Subject: [PATCH] Bug 776791 - [1.8.13 Regression] Segfault building the
breathe docs

Protected against NULL pointer of variable al
---
src/xmlgen.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index fe95c7a..70e198a 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -620,7 +620,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De
if (md->isInline()) t << "yes"; else t << "no";
t << "\"";

- if (al->refQualifier!=RefQualifierNone)
+ if (al!=0 && al->refQualifier!=RefQualifierNone)
{
t << " refqual=\"";
if (al->refQualifier==RefQualifierLValue) t << "lvalue"; else t << "rvalue";

0 comments on commit 6e7bb68

Please sign in to comment.