Merge pull request #172 from dave-tucker/name_trunc

aya: Fix name truncation
pull/174/head
Alessandro Decina 3 years ago committed by GitHub
commit b93188fefe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -418,8 +418,8 @@ fn load_program(prog_type: bpf_prog_type, data: &mut ProgramData) -> Result<(),
let prog_name = if let Some(name) = &data.name { let prog_name = if let Some(name) = &data.name {
let mut name = name.clone(); let mut name = name.clone();
if name.len() > 16 { if name.len() > 15 {
name.truncate(16); name.truncate(15);
} }
let prog_name = CString::new(name.clone()) let prog_name = CString::new(name.clone())
.map_err(|_| ProgramError::InvalidName { name: name.clone() })?; .map_err(|_| ProgramError::InvalidName { name: name.clone() })?;

Loading…
Cancel
Save