Commit 826c388
authored
Error for short out in MdCtxRef::digest_final() (#2608)
If a caller passes an output buffer that is shorter than the digest
size, digest_final() would write past its end, usually corrupting
the stack. This is reachable from safe rust.
Check the size and return an error if it is too small.1 parent 1d10902 commit 826c388
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
| |||
549 | 553 | | |
550 | 554 | | |
551 | 555 | | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
552 | 565 | | |
0 commit comments