Commit graph

380 commits

Author SHA1 Message Date
Martin Dindoffer
529a3daa6f Fix integer overflow in setListPointer size calculation 2022-08-08 16:28:52 +01:00
Martin Dindoffer
b1eadaee6c Fix intege overflow in _setBooleanElement in a primitive list 2022-08-08 16:28:52 +01:00
Martin Dindoffer
89d1c5722e Fix integer overflow in computeSerializedSizeInWords 2022-08-08 16:28:52 +01:00
Martin Dindoffer
e77372b1cd Fix integer overflow in bounds checking 2022-08-08 16:28:52 +01:00
Vaci Koblizek
949103ca5d Merge remote-tracking branch 'sandstorm/master' 2022-05-02 17:18:21 +01:00
Martin Dindoffer
89db62ae9a #122 Add bound checks for struct size
Also fix incorrect bounds comparison in SegmentReader
2022-04-09 10:36:07 -04:00
jan
3119bb5fab Fix generic structs with non-generic interface as type parameter. 2022-03-21 01:27:06 +01:00
Vaci Koblizek
7c521d5840 avoid var in ClientHook 2022-03-06 16:47:37 +00:00
Vaci Koblizek
3ec3dbae57 remove captable contexts from capability 2022-03-06 16:47:19 +00:00
Vaci Koblizek
f510bd19aa move captable contexts 2022-03-06 16:46:39 +00:00
Vaci
8c6b9c8caa Avoid use of var 2022-03-06 16:37:33 +00:00
Vaci Koblizek
4171577bf0 Move NULL and BROKEN brands to ClientHook 2022-03-06 14:09:49 +00:00
Vaci
59701de848 Provide fallback to original interface. 2022-03-06 14:09:42 +00:00
Vaci
3b4ee42cc3
remove unused import 2022-03-06 13:32:01 +00:00
Vaci Koblizek
9bb1032274 avoid truncating struct size 2021-11-10 12:13:27 +00:00
Vaci Koblizek
9a32482541 Merge remote-tracking branch 'sandstorm/master' into vaci/merge2 2021-11-10 11:15:53 +00:00
David Renshaw
ab303cbc28 add more robustness to integer wrapping problems 2021-10-08 14:24:22 -04:00
David Renshaw
57dec34d2c fix bug in short to int conversion in StructPointer 2021-10-05 17:03:57 -04:00
David Renshaw
8f5f200858 verify that a list pointer has the correct kind 2021-10-01 21:59:52 -04:00
David Renshaw
104fb11104 add bounds checking in readListPointer 2021-10-01 21:59:21 -04:00
David Renshaw
ddd43a491b throw exception on negative segment sizes 2021-10-01 21:56:49 -04:00
Vaci Koblizek
b24a362d58 Merge from upstream 2021-08-19 09:50:28 +01:00
David Renshaw
a55b869305 implement MessageBuilder.unsafeConstructFromMessageReader() 2021-05-24 13:06:42 -04:00
David Renshaw
a078df7e4d add support for directly serializing a MessageReader
Previously, you would need to copy the message into a MessageBuilder first.
2021-05-24 11:49:20 -04:00
David Renshaw
d310db1e88 Prevent potential integer overflow in BuilderArena.allocate(). 2021-05-13 17:49:01 -04:00
David Renshaw
4ec14e39f9 be more careful about integer overflow in Serialize.read()
Previously, we were attempting to read the entire message
in one call to fillBuffer(). This was doomed to fail
if the message had more than Integer.MAX_VALUE bytes.

After this diff, we will call fillBuffer() separately for each
segment. This approach turns out to be simpler, too.
It might imply a small performance hit for messages with
many small segments, but such messages are discouraged anyway.

This diff also adds more overflow checking in the surrounding
logic.
2021-05-12 20:13:52 -04:00
David Renshaw
8dbd5cf25f make new unit test less memory intensive 2021-05-11 21:12:10 -04:00
David Renshaw
eb73990798 fix potential overflow in DefaultAllocator
Fixes a bug where the allocator's `nextSize` variable could overflow
and become negative, causing more segments to be allocated than expected.

Also removes a duplicate `this.nextSize += size` statement that
likely made the problem worse.
2021-05-11 21:07:37 -04:00
David Renshaw
07e47d4104 add some documentation about the new 'no limit' option 2021-05-09 14:53:54 -04:00
Wim Dumon
cc4fa2bbc8 Offer option to disable traversalLimitInWords
Use case: large trusted input data file, mapped in memory by
MappedByteBuffer, which is often re-queried so a sensible
limit cannot be set.
2021-04-28 17:47:58 +02:00
Vaci Koblizek
950ba824b9 use java11 switches and completablefutures 2021-04-05 11:05:52 +01:00
Vaci Koblizek
c7621d1de3 whenMoreResolved should return null when resolved 2020-12-07 18:55:54 +00:00
Vaci Koblizek
21d3eba0e5 remove CompletableFutureWrapper 2020-12-05 14:55:28 +00:00
Vaci Koblizek
25c50b105d moar capTable context maintenance 2020-12-03 15:06:35 +00:00
Vaci Koblizek
196b82515c ensure StructBuilders and StructLists maintain capTable context 2020-12-03 14:25:15 +00:00
Vaci Koblizek
f74ad80dea remove cancellation completion for now 2020-12-03 14:25:15 +00:00
Vaci Koblizek
53eeed97e2 make direct call if QueuedClient has resolved 2020-12-01 17:12:49 +00:00
Vaci Koblizek
3b1f5f416c use lists for queued calls, clean up on resolution 2020-12-01 17:08:27 +00:00
Vaci Koblizek
837f1b324c add AnyList 2020-11-30 20:22:36 +00:00
Vaci Koblizek
2b5bf0eb21 tidy up branding and implement QueuedClient,getBrand() correctly 2020-11-30 18:52:28 +00:00
Vaci Koblizek
c04bdb8088 add clienthook commentary 2020-11-30 18:42:04 +00:00
Vaci Koblizek
d02e460f06 tidy up response and pipeline construction 2020-11-30 17:47:37 +00:00
Vaci Koblizek
66ee9471f9 replace Integers with FileDescriptors 2020-11-28 09:55:53 +00:00
Vaci Koblizek
ab44843b12 QueuedClient should stop queuing calls once it has resolved 2020-11-27 15:24:41 +00:00
Vaci Koblizek
789d2df6e4 replace PipelineOp[] with short[] 2020-11-27 13:30:35 +00:00
Vaci Koblizek
a53f7db25e remove extraneous ArrayList wrapper from ops key 2020-11-27 11:30:12 +00:00
Vaci Koblizek
250f14e2f4 simplify QueuedPipeline promise 2020-11-27 11:25:39 +00:00
Vaci Koblizek
6e5bcc62ae replace typeless requests with anonymous implementations 2020-11-27 10:19:06 +00:00
Vaci Koblizek
585a21259e remove unused AnyRequest.send() 2020-11-27 09:50:26 +00:00
Vaci Koblizek
a3837e6010 message loop exit logging level as FINE 2020-11-26 16:09:07 +00:00