git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
031117f
)
Specific check for null pointer
author
Jeremy Harris
<jgh146exb@wizmail.org>
Fri, 18 Feb 2022 15:45:37 +0000
(15:45 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Fri, 18 Feb 2022 15:45:37 +0000
(15:45 +0000)
src/src/smtp_out.c
patch
|
blob
|
history
diff --git
a/src/src/smtp_out.c
b/src/src/smtp_out.c
index 608a781eb7fbca5ccb82833267a5f8626ebec0b4..fc1e6cecd8d62cec0b7cfff53a10d15abc44ce4a 100644
(file)
--- a/
src/src/smtp_out.c
+++ b/
src/src/smtp_out.c
@@
-524,13
+524,21
@@
flush_buffer(smtp_outblock * outblock, int mode)
int rc;
int n = outblock->ptr - outblock->buffer;
BOOL more = mode == SCMD_MORE;
int rc;
int n = outblock->ptr - outblock->buffer;
BOOL more = mode == SCMD_MORE;
+client_conn_ctx * cctx;
HDEBUG(D_transport|D_acl) debug_printf_indent("cmd buf flush %d bytes%s\n", n,
more ? " (more expected)" : "");
HDEBUG(D_transport|D_acl) debug_printf_indent("cmd buf flush %d bytes%s\n", n,
more ? " (more expected)" : "");
+if (!(cctx = outblock->cctx))
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC, "null conn-context pointer");
+ errno = 0;
+ return FALSE;
+ }
+
#ifndef DISABLE_TLS
#ifndef DISABLE_TLS
-if (
outblock->cctx->tls_ctx)
- rc = tls_write(
outblock->
cctx->tls_ctx, outblock->buffer, n, more);
+if (
cctx->tls_ctx) /*XXX have seen a null cctx here, rvfy sending QUIT, hence check above */
+ rc = tls_write(cctx->tls_ctx, outblock->buffer, n, more);
else
#endif
else
#endif
@@
-544,7
+552,7
@@
else
requirement: TFO with data can, in rare cases, replay the data to the
receiver. */
requirement: TFO with data can, in rare cases, replay the data to the
receiver. */
- if ( (
outblock->
cctx->sock = smtp_connect(outblock->conn_args, &early_data))
+ if ( (cctx->sock = smtp_connect(outblock->conn_args, &early_data))
< 0)
return FALSE;
outblock->conn_args = NULL;
< 0)
return FALSE;
outblock->conn_args = NULL;
@@
-552,7
+560,7
@@
else
}
else
{
}
else
{
- rc = send(
outblock->
cctx->sock, outblock->buffer, n,
+ rc = send(cctx->sock, outblock->buffer, n,
#ifdef MSG_MORE
more ? MSG_MORE : 0
#else
#ifdef MSG_MORE
more ? MSG_MORE : 0
#else
@@
-567,7
+575,7
@@
else
https://bugzilla.redhat.com/show_bug.cgi?id=1803806 */
if (!more)
https://bugzilla.redhat.com/show_bug.cgi?id=1803806 */
if (!more)
- setsockopt(
outblock->
cctx->sock, IPPROTO_TCP, TCP_CORK, &off, sizeof(off));
+ setsockopt(cctx->sock, IPPROTO_TCP, TCP_CORK, &off, sizeof(off));
#endif
}
}
#endif
}
}