Commit 13fb9e3
committed
Feature: libcrmcommon: decode_transition_magic() validates more strictly
Technically this changes the behavior of a public API function.
* We now reject transition magic strings that begin with whitespace.
* We now reject transition magic strings whose op_status or op_rc field
begins with a plus sign. These fields must now consist of an optional
minus sign followed by digits.
* We now reject transition magic strings whose op_status or op_rc field
overflows the range of an int.
* We now preserve any whitespace at the end of a transition magic
string.
These are all side effects of replacing the sscanf() calls with a regex
match and explicit integer parsing.
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>1 parent 6f791c6 commit 13fb9e3
1 file changed
Lines changed: 36 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
391 | 392 | | |
392 | | - | |
393 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
394 | 399 | | |
395 | | - | |
396 | | - | |
397 | 400 | | |
398 | 401 | | |
399 | 402 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
410 | 419 | | |
411 | 420 | | |
412 | 421 | | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
417 | 427 | | |
418 | 428 | | |
419 | 429 | | |
420 | 430 | | |
421 | | - | |
| 431 | + | |
422 | 432 | | |
423 | 433 | | |
424 | 434 | | |
425 | | - | |
| 435 | + | |
426 | 436 | | |
427 | 437 | | |
428 | | - | |
| 438 | + | |
429 | 439 | | |
430 | 440 | | |
431 | 441 | | |
432 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
433 | 445 | | |
434 | 446 | | |
435 | 447 | | |
| |||
0 commit comments