Skip to content

Conversation

@ChrisCoxArt
Copy link
Contributor

Fixes #447

Pull Request Checklist

  • Have you followed the guidelines in Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you built your Pull Request locally with the Build Instructions?
  • Have you added or updated relevant tests?
  • Have you added or updated relevant docs?

Create function to find and return first of either macro syntax.
Add tweaks to CIccMpeXmlCalculator::ValidMacroCalls to deal with both syntax forms.
remove my previous self reference detection, now that we have more robust recursion detection for macros.
@ChrisCoxArt ChrisCoxArt requested a review from maxderhak January 6, 2026 21:14
@ChrisCoxArt ChrisCoxArt requested a review from xsscx as a code owner January 6, 2026 21:14
@xsscx xsscx self-assigned this Jan 6, 2026
@xsscx xsscx added PR Pull Request Review in Process PR being Reviewed by Maintainers labels Jan 6, 2026
Copy link
Member

@xsscx xsscx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repro

Tue Jan 6 16:31:09 EST 2026

1b60a4b
1b60a4b (HEAD -> pr-450, origin/issue-447) remove old fix for #384

git clone https://github.com/InternationalColorConsortium/iccDEV.git
cd iccDEV/Build
git fetch origin pull/450/head:pr-450
git checkout pr-450
         cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX="$HOME/.local" -DCMAKE_BUILD_TYPE=Debug -Wno-dev -DCMAKE_CXX_FLAGS="-g -fsanitize=address,undefined -fno-sanitize=leak -fno-omit-frame-pointer -Wall" -DENABLE_TOOLS=ON -DENABLE_STATIC_LIBS=ON -DENABLE_SHARED_LIBS=ON Cmake > cmake.log 2>&1
make -j32

        cd ../Testing/
        echo "=== Updating PATH ==="
         for d in ../Build/Tools/*; do
          [ -d "$d" ] && export PATH="$(realpath "$d"):$PATH"
         done

wget https://raw.githubusercontent.com/xsscx/Commodity-Injection-Signatures/refs/heads/master/xml/icc/issue-384-moreEvil.xml

iccFromXml issue-384-moreEvil.xml oops.icc

Expected Output

Macro recursion detected in call to 'b'
Unable to parse element of type CIccMpeXmlCalculator
Unable to parse element (CalculatorElement) starting on line 88
Unable to Parse "multiProcessElementType" (BToA1Tag) Tag on line 87

Unable to Parse 'issue-384-moreEvil.xml'

@xsscx xsscx changed the title More robust recursion detection for XML macros Modify: recursion detection for XML macros Jan 6, 2026
@xsscx xsscx merged commit 2c3cfe6 into master Jan 6, 2026
21 checks passed
@xsscx xsscx added Merged Merged and removed Review in Process PR being Reviewed by Maintainers labels Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged Merged PR Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stack-overflow in CIccMpeXmlCalculator::Flatten() at IccXML/IccLibXML/IccMpeXml.cpp:2695 Modify: Initial call to ValidMacroCalls()

3 participants