Commit b287487
committed
fix(encoding): ensure input is well-formed before allocation
Perform dm.Wellformed() check on the input at the beginning of
structFieldsCBOR.FromCBOR(). This prevents, among other things, random
byte sequences from being interpreted as map headers with a large size
and then waiting on the allocation.
Signed-off-by: Sergei Trofimov <sergei.trofimov@arm.com>1 parent 53b3014 commit b287487
3 files changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
| 304 | + | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
282 | 295 | | |
283 | 296 | | |
284 | 297 | | |
285 | 298 | | |
286 | 299 | | |
287 | 300 | | |
288 | | - | |
| 301 | + | |
289 | 302 | | |
290 | | - | |
| 303 | + | |
291 | 304 | | |
292 | | - | |
| 305 | + | |
293 | 306 | | |
294 | 307 | | |
295 | 308 | | |
| |||
0 commit comments