-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
surprising bug if n > 65535 -- array slice offset/size overflow #1108
Comments
Oh. Wow. Fixing this one is going to be fun. Here's the problem:
See that I can think of several fixes. One is to fix jv_array_slice() to allocate a new array when the start point of the slice is larger than 65535 and copy the slice -- this is slow if you have huge arrays. Another is to modify |
I'm not fond of |
Related issues: - Issue jqlang#1108 surprising bug if n > 65535 jqlang#1108
Ah, yes, I should not forget this one. |
I've discussed this with @stedolan. The simplest thing to do is to simply create a new array that is a copy of the requested slice when the It's also worth noting that @stedolan agrees that we must not enlarge |
Thanks for catching this @pkoppstein! |
@nicowilliams - And thank you for working on this and other issues. Unfortunately, this particular issue has not yet been fully resolved:
|
@pkoppstein Ah, yes, an off-by-one bug. Thanks again! |
@pkoppstein I pushed a fix for that. Can you bang on it some more? |
@nicowilliams - Banged some. As you would say, LGTM. Tx. |
@pkoppstein Thanks! |
Wasted a lot of time trying to figure this out, I think you should really cut a release. RC is not good enough, this is a serious bug. |
Just to add another voice here as well - this caught us out, using the npm package, "node-jq". This wraps jq, and we were seeing issues trying to read very large files in chunks. Finally figured out it was wrapping at (unsigned short) - and then found this bug. Is there a possibility of a new release of jq? |
The text was updated successfully, but these errors were encountered: