Skip to content

Commit eb4a0ba

Browse files
committed
Enable address sanitizer without leak detector (yet)
Fix buffer overflow in luaO_chunkid
1 parent 3977b53 commit eb4a0ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: dtolnay/rust-toolchain@nightly
1414
- name: Run tests
1515
run: |
16-
RUSTFLAGS="-D warnings" cargo test
16+
RUSTFLAGS="-D warnings -Z sanitizer=address" ASAN_OPTIONS=detect_leaks=0 cargo test
1717
1818
rustfmt:
1919
name: Rustfmt

src/lobject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,6 @@ pub unsafe extern "C" fn luaO_chunkid(
12781278
memcpy(out as *mut c_void, cstr!("...") as *const c_void, 3);
12791279
out = out.add(3);
12801280
}
1281-
memcpy(out as *mut c_void, cstr!("\"]") as *const c_void, 4);
1281+
memcpy(out as *mut c_void, cstr!("\"]") as *const c_void, 3);
12821282
};
12831283
}

0 commit comments

Comments
 (0)