Skip to content

Commit cf5efdb

Browse files
committed
Increase panic buffer size and add description to format error message
Signed-off-by: adamperlin <adamp@nanosoft.com>
1 parent f75d9fc commit cf5efdb

File tree

1 file changed

+3
-3
lines changed
  • src/hyperlight_guest_bin/src

1 file changed

+3
-3
lines changed

src/hyperlight_guest_bin/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
146146

147147
#[inline(always)]
148148
fn _panic_handler(info: &core::panic::PanicInfo) -> ! {
149-
// stack allocate a 256-byte message buffer.
150-
let mut panic_buf = String::<256>::new();
149+
// stack allocate a 512-byte message buffer.
150+
let mut panic_buf = String::<512>::new();
151151
let write_res = write!(panic_buf, "{}\0", info);
152152
if write_res.is_err() {
153153
unsafe {
154154
abort_with_code_and_message(
155155
&[ErrorCode::UnknownError as u8],
156-
c"panic: message format failed".as_ptr(),
156+
c"panic: message format failed (limit: 512 bytes)".as_ptr(),
157157
)
158158
}
159159
}

0 commit comments

Comments
 (0)