Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadXmlObjectConnectionShape() always crashes when reader is named "off" #369

Open
Tyler799 opened this issue Nov 25, 2024 · 1 comment
Open

Comments

@Tyler799
Copy link

In the following function:

void DrawingAnchor::loadXmlObjectConnectionShape(QXmlStreamReader &reader)

The following code is called:

else if (reader.name() == QLatin1String("off")) {
                posTA     = loadXmlPos(reader);
                hasoffext = true;

That is wrong. It will try to call the following method:

QPoint DrawingAnchor::loadXmlPos(QXmlStreamReader &reader)
{
    Q_ASSERT(reader.name() == QLatin1String("pos"));

    QPoint pos;
    QXmlStreamAttributes attrs = reader.attributes();
    pos.setX(attrs.value(QLatin1String("x")).toInt());
    pos.setY(attrs.value(QLatin1String("y")).toInt());
    return pos;
}

But since the reader's name is "off" and not "pos", the assert will fail and the program will crash.

I cannot send the spreadsheet I noticed causing this issue, so this is the best I can give you.

@j2doll
Copy link
Member

j2doll commented Jan 7, 2025

Dear @Tyler799

Thanks for reporting! 😄

Can you pull request to your test code or test data to https://github.com/QtExcel-Issue/QXlsx-369 ?

Or, Can you show us your test case ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants