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

Segfault in String.prototype.toBytes() for negative arguments. #155

xeioex opened this issue May 7, 2019 · 0 comments


None yet
2 participants
Copy link

commented May 7, 2019

>> "A".repeat(38).toBytes(-5)
==16054==ERROR: AddressSanitizer: SEGV on unknown address 0x6090000168e0 (pc 0x00000042c455 bp 0x7fffa72fbb30 sp 0x7fffa72fbaf0 T0)
    #0 0x42c454 in nxt_utf8_next nxt/nxt_utf8.h:44
    #1 0x42c454 in njs_string_offset njs/njs_string.c:2058
    #2 0x4282cd in njs_string_prototype_to_bytes njs/njs_string.c:1047
    #3 0x45f1f2 in njs_function_native_call njs/njs_function.c:587
    #4 0x41bd8f in njs_vmcode_function_call njs/njs_vm.c:2061
    #5 0x413d10 in njs_vmcode_interpreter njs/njs_vm.c:159
    #6 0x412be5 in njs_vm_start njs/njs.c:594
    #7 0x4049a7 in njs_process_script njs/njs_shell.c:770
    #8 0x4037ad in njs_interactive_shell njs/njs_shell.c:500
    #9 0x402a03 in main njs/njs_shell.c:270

Minified test from fluff report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.