sd-device: do no allocate strings of unknown length on the stack

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33881.

Not only we would duplicate unknown input on the stack, we would do it
over and over. So let's first check that the input has reasonable length,
but also allocate just one fixed size buffer.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-05-05 17:15:04 +02:00
parent 7ecb052fb3
commit e17c95af8e
2 changed files with 31 additions and 27 deletions
File diff suppressed because one or more lines are too long