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 memory access out of bounds in numpy + chrome 89 #1474

Merged
merged 23 commits into from
Apr 17, 2021
Merged
Prev Previous commit
Next Next commit
Forgot some semicolons
  • Loading branch information
Hood committed Apr 15, 2021
commit 8d15840123c6464580828858b4124ed749dd2b25
8 changes: 4 additions & 4 deletions packages/numpy/patches/0001-temp.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9acf1ade730da70f73bbdef4cf4a0ab37be21e41 Mon Sep 17 00:00:00 2001
From c0bf24114eece408d1bfa93514f080a5da3712e2 Mon Sep 17 00:00:00 2001
From: Hood <hood@mit.edu>
Date: Fri, 2 Apr 2021 14:24:24 -0700
Subject: [PATCH] temp
Expand Down Expand Up @@ -33,7 +33,7 @@ index 52cb58726..5467f4d78 100644
}
return nd;
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index 9da811f69..291c4c0af 100644
index 9da811f69..2fdaf560b 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -1153,6 +1153,37 @@ NPY_NO_EXPORT PyTypeObject PyArrayIter_Type = {
Expand Down Expand Up @@ -111,9 +111,9 @@ index 9da811f69..291c4c0af 100644
}
- if (mit->dimensions[i] == 1) {
- mit->dimensions[i] = tmp;
+ tmp2 = READ_INTP(&mit->dimensions[i])
+ tmp2 = READ_INTP(&mit->dimensions[i]);
+ if (tmp2 == 1) {
+ WRITE(&mit->dimensions[i], tmp)
+ WRITE(&mit->dimensions[i], tmp);
}
- else if (mit->dimensions[i] != tmp) {
+ else if (tmp2 != tmp) {
Expand Down