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

fix cursor.cc reading an empty string error when compile without "-o2… #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryanhuang
Copy link

fix cursor.cc reading an empty string error when compile without "-o2…

void
cursor::string(std::string &out)
{
        size_t size;
        const char *p = this->cstr(&size);
        out.resize(size);
	if (size > 0)
	{
        	memmove(&out.front(), p, size);
	}
}

without -o2, "memmove(&out.front(), p, 0) will raise an assert error in gcc8.1.4 centos 8.5(4.18.0-348.2.1.el8_5.x86_64)"

Woazboat added a commit to Woazboat/sweb that referenced this pull request Mar 25, 2023
… string

Bug found in SWEB by https://github.com/Ferdi265

Open pull request on the upstream project that's been ignored so
far... aclements/libelfin#63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant