Commit f063d38
daemon: use cld->env_array when re-spawning
This avoids an ugly strcat into a fixed-size buffer. It's
not wrong (the buffer is plenty large enough for an IPv6
address plus some minor formatting), but it takes some
effort to verify that.
Unfortunately we are still stuck with some fixed-size
buffers to hold the output of inet_ntop. But at least we now
pass very easy-to-verify parameters, rather than doing a
manual computation to account for other data in the buffer.
As a side effect, this also fixes the case where we might
pass an uninitialized portbuf buffer through the
environment. This probably couldn't happen in practice, as
it would mean that addr->sa_family was neither AF_INET nor
AF_INET6 (and that is all we are listening on).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 0b282cc commit f063d38
1 file changed
+10
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
815 | | - | |
816 | 814 | | |
817 | 815 | | |
818 | 816 | | |
| |||
826 | 824 | | |
827 | 825 | | |
828 | 826 | | |
| 827 | + | |
829 | 828 | | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
834 | 833 | | |
835 | 834 | | |
| 835 | + | |
836 | 836 | | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
846 | 841 | | |
847 | 842 | | |
848 | 843 | | |
849 | | - | |
850 | 844 | | |
851 | 845 | | |
852 | 846 | | |
| |||
0 commit comments