| 9 | |
| 10 | |
| 11 | static bool next_size(const u8 **cursor, size_t *max, size_t *size) |
| 12 | { |
| 13 | size_t len; |
| 14 | varint_t varint; |
| 15 | |
| 16 | if (*max < 1) |
| 17 | return false; |
| 18 | |
| 19 | len = varint_get(*cursor, *max, &varint); |
| 20 | |
| 21 | if (len < 1) |
| 22 | return false; |
| 23 | |
| 24 | if (*max < len) { |
| 25 | *max = 0; |
| 26 | return false; |
| 27 | } |
| 28 | |
| 29 | *cursor += len; |
| 30 | *max -= len; |
| 31 | *size = varint; |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | static u8 *next_script(const tal_t *ctx, const u8 **cursor, size_t *max) |
| 36 | { |
no test coverage detected