Commit 9568963
committed
cache-tree: use parse_int_from_buf()
In c4c9089 (cache-tree: avoid strtol() on non-string buffer,
2025-11-18) we wrote an ad-hoc integer parser which did not detect
overflow. This wasn't too big a problem, since the original use of
strtol() did not do so either. But now that we have a more robust
parsing function, let's use that. It reduces the amount of code and
should catch more cases of malformed entries.
I kept our local parse_int() wrapper here, since it handles management
of our ptr/len pair (rather than doing it inline in the entry parser of
read_one()).1 parent 0e6097f commit 9568963
1 file changed
+5
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
| 554 | + | |
572 | 555 | | |
573 | | - | |
| 556 | + | |
574 | 557 | | |
575 | 558 | | |
576 | | - | |
577 | | - | |
578 | | - | |
| 559 | + | |
| 560 | + | |
579 | 561 | | |
580 | 562 | | |
581 | 563 | | |
| |||
0 commit comments