<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.7
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/3b873efeb50e7601e48f54c177157eb6e6d3e9ee">https://github.com/macports/macports-base/commit/3b873efeb50e7601e48f54c177157eb6e6d3e9ee</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 3b873efeb50e7601e48f54c177157eb6e6d3e9ee
</span>Author: Zero King <l2dy@macports.org>
AuthorDate: Thu Feb 10 15:14:16 2022 +0000
<span style='display:block; white-space:pre;color:#404040;'> darwintracelib1.0: check return value before use
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit dd795bd03d988eb49cbc25191b32253f3e9b9ec1)
</span>---
src/darwintracelib1.0/darwintrace.c | 3 +++
src/darwintracelib1.0/proc.c | 3 +++
2 files changed, 6 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/darwintracelib1.0/darwintrace.c b/src/darwintracelib1.0/darwintrace.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 4719bedf..466d984f 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/darwintracelib1.0/darwintrace.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/darwintracelib1.0/darwintrace.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -623,6 +623,9 @@ static char *__send(const char *buf, uint32_t len, int answer) {
</span> }
recv_buf = malloc(recv_len + 1);
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (recv_buf == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> recv_buf[recv_len] = '\0';
frecv(recv_buf, recv_len);
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/darwintracelib1.0/proc.c b/src/darwintracelib1.0/proc.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 3d0fa5cf..ff65b057 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/darwintracelib1.0/proc.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/darwintracelib1.0/proc.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -214,6 +214,9 @@ static inline int check_interpreter(const char *restrict path) {
</span> * bytes left before the end-of-file, but in no other case.
* That _does_ save us another ugly loop to get things right. */
bytes_read = read(fd, buffer, sizeof(buffer) - 1);
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (bytes_read < 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> buffer[bytes_read] = '\0';
close(fd);
</pre><pre style='margin:0'>
</pre>