File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
crates/std_detect/src/detect/os/linux Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 1
1
//! Parses ELF auxiliary vectors.
2
2
#![ cfg_attr( not( target_arch = "aarch64" ) , allow( dead_code) ) ]
3
3
4
+ pub ( crate ) const AT_NULL : usize = 0 ;
5
+
4
6
/// Key to access the CPU Hardware capabilities bitfield.
5
7
pub ( crate ) const AT_HWCAP : usize = 16 ;
6
8
/// Key to access the CPU Hardware capabilities 2 bitfield.
@@ -170,6 +172,7 @@ fn auxv_from_buf(buf: &[usize; 64]) -> Result<AuxVec, ()> {
170
172
{
171
173
for el in buf. chunks ( 2 ) {
172
174
match el[ 0 ] {
175
+ AT_NULL => break ,
173
176
AT_HWCAP => return Ok ( AuxVec { hwcap : el[ 1 ] } ) ,
174
177
_ => ( ) ,
175
178
}
@@ -186,6 +189,7 @@ fn auxv_from_buf(buf: &[usize; 64]) -> Result<AuxVec, ()> {
186
189
let mut hwcap2 = None ;
187
190
for el in buf. chunks ( 2 ) {
188
191
match el[ 0 ] {
192
+ AT_NULL => break ,
189
193
AT_HWCAP => hwcap = Some ( el[ 1 ] ) ,
190
194
AT_HWCAP2 => hwcap2 = Some ( el[ 1 ] ) ,
191
195
_ => ( ) ,
You can’t perform that action at this time.
0 commit comments