Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of work on bindings #397

Merged
merged 10 commits into from Apr 24, 2013

Fix write past buffer length for proxy toString operation.

  • Loading branch information
jdm committed Apr 23, 2013
commit 6c6d070dab43d96ba5724d3e5007025c56ff290e
@@ -62,7 +62,7 @@ pub fn _obj_toString(cx: *JSContext, className: *libc::c_char) -> *JSString {
unsafe {
let name = str::raw::from_buf(className as *u8);
let nchars = "[object ]".len() + name.len();
let chars: *mut jschar = cast::transmute(JS_malloc(cx, nchars as u64 * (size_of::<jschar>() as u64)));
let chars: *mut jschar = cast::transmute(JS_malloc(cx, (nchars + 1) as u64 * (size_of::<jschar>() as u64)));
if chars.is_null() {
return ptr::null();
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.