summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-07 17:10:59 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-02-07 17:10:59 -0800
commit67ffde62e837f4b466141366c238ff134cf36edd (patch)
tree94ad6689846adc8ce6e3c19158a1ba246af695e5
parent4e297db3cf54a629a2c8f38b068cd4f8434afa4c (diff)
DataFromClient: Avoid segfault if FlushFD() closed the connection
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--scope.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index c07274a..b414d22 100644
--- a/scope.c
+++ b/scope.c
@@ -1138,6 +1138,9 @@ DataFromClient(FD fd)
FDinfo[ServerFD].bufstart = 0;
FlushFD(ServerFD);
+ if (FDinfo[ServerFD].buffer == NULL) /* connection closed in FlushFD */
+ return;
+
/* also report the bytes to standard out */
ReportFromClient(fd, FDinfo[ServerFD].buffer, n);
}