Skip to content

Commit 8bd3110

Browse files
fix(gethostname): null terminate the resulting str
Signed-off-by: Anhad Singh <[email protected]>
1 parent 46bf24c commit 8bd3110

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/aero_kernel/src/syscall/process.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ pub fn gethostname(buffer: &mut [u8]) -> Result<usize> {
267267
Err(SyscallError::ENAMETOOLONG)
268268
} else {
269269
buffer[0..bytes.len()].copy_from_slice(bytes);
270+
buffer[bytes.len()] = b'\0';
270271

271272
Ok(bytes.len())
272273
}

0 commit comments

Comments
 (0)