Commit 42c7732
committed
selinux: improve error checking in sel_write_load()
Move our existing input sanity checking to the top of sel_write_load()
and add a check to ensure the buffer size is non-zero.
Move a local variable initialization from the declaration to before it
is used.
Minor style adjustments.
Reported-by: Sam Sun <samsun1006219@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>1 parent e6b5ebc commit 42c7732
1 file changed
Lines changed: 16 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
579 | 586 | | |
580 | 587 | | |
581 | 588 | | |
582 | 589 | | |
583 | 590 | | |
584 | 591 | | |
585 | 592 | | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | 593 | | |
593 | | - | |
| 594 | + | |
| 595 | + | |
594 | 596 | | |
595 | | - | |
596 | | - | |
597 | | - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
598 | 600 | | |
| 601 | + | |
599 | 602 | | |
600 | 603 | | |
601 | 604 | | |
602 | 605 | | |
603 | 606 | | |
604 | 607 | | |
605 | | - | |
| 608 | + | |
606 | 609 | | |
607 | 610 | | |
608 | 611 | | |
| |||
611 | 614 | | |
612 | 615 | | |
613 | 616 | | |
614 | | - | |
615 | 617 | | |
616 | | - | |
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
| 622 | + | |
621 | 623 | | |
622 | 624 | | |
623 | 625 | | |
| |||
0 commit comments