Commit 40c6a28
Harden persisted symbol-dict edge paths
Fold in low-severity hardening found in review; none changes behavior
on any reachable input.
PersistedSymbolDict:
- appendRawEntries fails loudly (rather than flushing an uninitialised
scratch tail and mis-advancing size) if a caller ever passes an
(addr, len, count) triple whose entries do not fill len; the sole
caller derives both from one beginMessage, so this cannot fire today.
- openExisting sets entriesLen alongside the malloc, so the catch frees
the right size if the copy walk throws -- the comment already claimed
this held.
- ensureScratch grows in long so scratchCap*2 cannot overflow negative
past ~1 GB, matching ensureSentDictCapacity.
- Two varint decode loops gain the shift > 35 bound the other decoders
already carry.
Close a file-descriptor leak in the rmDir test helpers: Files.walk
returns a Stream backed by an open directory handle, so wrap it in
try-with-resources (PersistedSymbolDictTest calls rmDir 13 times).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c065ad4 commit 40c6a28
4 files changed
Lines changed: 70 additions & 30 deletions
File tree
- core/src
- main/java/io/questdb/client/cutlass/qwp/client/sf/cursor
- test/java/io/questdb/client/test/cutlass/qwp/client
- sf/cursor
Lines changed: 32 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
| |||
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
245 | 261 | | |
246 | 262 | | |
247 | 263 | | |
| |||
503 | 519 | | |
504 | 520 | | |
505 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
506 | 525 | | |
507 | 526 | | |
508 | 527 | | |
| |||
516 | 535 | | |
517 | 536 | | |
518 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
519 | 541 | | |
520 | 542 | | |
521 | 543 | | |
522 | 544 | | |
523 | 545 | | |
524 | 546 | | |
525 | 547 | | |
526 | | - | |
527 | 548 | | |
528 | 549 | | |
529 | 550 | | |
| |||
601 | 622 | | |
602 | 623 | | |
603 | 624 | | |
604 | | - | |
605 | | - | |
606 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
607 | 635 | | |
608 | 636 | | |
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
| |||
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
| |||
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
| |||
0 commit comments