Commit 1144ea3
committed
Prevent shm_mq_send from reading uninitialized memory.
shm_mq_send_bytes didn't invariably initialize *bytes_written before
returning, which would cause shm_mq_send to read from uninitialized
memory and add the value it found there to mqh->mqh_partial_bytes.
This could cause the next attempt to send a message via the queue to
fail an assertion (if the queue was detached) or copy data from a
garbage pointer value into the queue (if non-blocking mode was in use).1 parent 250c26b commit 1144ea3
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
| 680 | + | |
679 | 681 | | |
| 682 | + | |
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
| |||
691 | 694 | | |
692 | 695 | | |
693 | 696 | | |
| 697 | + | |
| 698 | + | |
694 | 699 | | |
| 700 | + | |
695 | 701 | | |
696 | 702 | | |
697 | 703 | | |
698 | 704 | | |
699 | 705 | | |
| 706 | + | |
700 | 707 | | |
701 | 708 | | |
702 | 709 | | |
| |||
0 commit comments