Skip to content

Commit 2222725

Browse files
fix: V-001 security vulnerability
Automated security fix generated by OrbisAI Security
1 parent 63238b7 commit 2222725

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • base/count-falsy/include/stdlib/ndarray/base/count-falsy/macros

base/count-falsy/include/stdlib/ndarray/base/count-falsy/macros/10d_blocked.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "stdlib/ndarray/ctor.h"
2828
#include <stdint.h>
2929
#include <string.h>
30+
#include <assert.h>
3031

3132
/**
3233
* Macro containing the preamble for blocked nested loops which operate on elements of a ten-dimensional ndarray.
@@ -109,6 +110,8 @@
109110
int64_t j7; \
110111
int64_t j8; \
111112
int64_t j9; \
113+
/* Ensure the ndarray has the expected number of dimensions: */ \
114+
assert( stdlib_ndarray_ndims( x1 ) == 10 ); \
112115
/* Copy strides to prevent mutation to the original ndarray: */ \
113116
memcpy( sx1, stdlib_ndarray_strides( x1 ), sizeof sx1 ); \
114117
/* Create a loop interchange index array for loop order permutation: */ \

0 commit comments

Comments
 (0)