-
Notifications
You must be signed in to change notification settings - Fork 511
Regression: out of bounds write on loading file #431
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
Comments
What about: diff --git a/src/mesh.cpp b/src/mesh.cpp
index 7767901..ba3c116 100644
--- a/src/mesh.cpp
+++ b/src/mesh.cpp
@@ -194,7 +194,7 @@ void SMesh::Simplify(int start) {
conv[WRAP((j+1), convc)] = c;
} else if(bDot > 0 && dDot > 0) {
// conv[j] is unchanged, conv[j+1] goes to [j+2]
- std::move_backward(conv+j+1, conv+convc, conv+j+2);
+ std::move_backward(conv+j+1, conv+convc-1, conv+j+2);
conv[j+1] = c;
convc++;
} else { |
Uh. This? diff --git a/src/mesh.cpp b/src/mesh.cpp
index 7767901..8ab27e0 100644
--- a/src/mesh.cpp
+++ b/src/mesh.cpp
@@ -186,7 +186,7 @@ void SMesh::Simplify(int start) {
if(fabs(bDot) < LENGTH_EPS && fabs(dDot) < LENGTH_EPS) {
conv[WRAP((j+1), convc)] = c;
// and remove the vertex at j, which is a dup
- std::move(conv+j+1, conv+convc, conv+(convc-1));
+ std::move(conv+j+1, conv+convc, conv+j);
convc--;
} else if(fabs(bDot) < LENGTH_EPS && dDot > 0) {
conv[j] = c; |
Hmm, nope, that's back to the original crash.
|
Oh, oops. Fixed in 9faa7cb. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System information
SolveSpace version: master branch commit 43a59e2
Git bisect reports that cc10788 is the first broken commit.
Operating system: Debian Buster
Expected behavior
Should be able to open this file, just as I did earlier this week.
Actual behavior
Crashes in DeleteAllTemporaries with a glibc error:
web search suggested out of bounds write to blame.
Additional information
This is the file that fails to open:
screwdriver-sheath-with-taper-skinny-screwdriver.zip
This is a closely-related one (its predecessor, since I'm using the "save as" method of version control for these) that does still open in master.
screwdriver-sheath-with-taper.zip
The text was updated successfully, but these errors were encountered: