yet reused. Reported by Qualys, assisted by Claude Mythos
Preview. File: postdrop.c.
+20260708
+
+ Bug (defect introduced: Postfix 3.0, date: 20141117): don't
+ free() text before logging a fatal error message. Reported
+ by Qualys, assisted by Claude Mythos Preview. File:
+ postqueue/postqueue.c.
+
+ Code hygiene: swap the 'offset' and 'whence' arguments in
+ vstream_fseek() calls. Reported by Qualys, assisted by
+ Claude Mythos Preview. Files: postmap.c, postalias.c.
+
+ Bug (defect introduced: before Postfix alpha, date: 19971029):
+ don't allow type-0 records. Reported by Qualys, assisted
+ by Claude Mythos Preview. File: pickup.c.
+
+ Code hygiene: don't allow type-0 records. File: postdrop.c.
+
+ Bug (defect introduced: Postfix 2.3, date: 20050323): the
+ SMTP client enhanced status code parser could process stale
+ data. Reported by Qualys, assisted by Claude Mythos Preview.
+ File: smtp_chat.c.
+
+20260709
+
+ Future proofing in smtpd_xforward_init(). Suggested by
+ Qualys, assisted by Claude Mythos Preview. File: smtpd_xforward.c.
+
+ Bug (defect introduced: Postfix 3.6, date: 20200710): memory
+ leak in tls_dane_add_fpt_digests(), triggered by local
+ configuration error. Reported by Qualys, assisted by Claude
+ Mythos Preview. File: tls_dane.c.
+
+ Bug (defect introduced: before Postfix alpha, date: 19970323):
+ the strerror() emulation function used the wrong indexing
+ variable. This function is used on systems from the previous
+ century. Reported by Qualys, assisted by Claude Mythos
+ Preview. File: sys_compat.c.
+
+ Bug (defect introduced: before Postfix alpha, date: 19970411):
+ the unused vstring_import() function did not respect a
+ VSTRING invariant. Reported by Qualys, assisted by Claude
+ Mythos Preview. File: vstring.c.
+
+ Latent bug (defect introduced: Postfix 3.6, date: 20200710): in
+ tls_scache_decode(), enforce a minimum length invariant by
+ disallowing ':' in hex-encoded TLS session cache entries.
+ Reported by Qualys, assisted by Claude Mythos Preview. File:
+ tls_scache.c.
+
+ Latent bug (defect introduced: Postfix 3.11, date: 20260219):
+ The DICT_FLAG_SURROGATE flag was mis-implemented. This flag
+ was used in test code. Reported by Qualys, assisted by
+ Claude Mythos Preview. Files: dict.h, dict.c.
+
TODO
Reorganize PTEST_LIB, PMOCK_LIB, TESTLIB, TESTLIBS, etc.
* We must allow PTR records here because of "postsuper -r".
*/
for (;;) {
- if ((type = rec_get(qfile, buf, var_line_limit)) < 0
+ /* 202606 Qualys+Mythos: don't allow type-0 records. */
+ if ((type = rec_get(qfile, buf, var_line_limit)) <= 0
|| strchr(expected, type) == 0)
return (file_read_error(info, type));
if (msg_verbose)
* recoverable error.
*/
for (;;) {
+ /* 202606 Qualys+Mythos: don't swap 'offset' and 'whence'. */
if (dict_isjmp(mkmap->dict) != 0
&& dict_setjmp(mkmap->dict) != 0
- && vstream_fseek(source_fp, SEEK_SET, 0) < 0)
+ && vstream_fseek(source_fp, 0, SEEK_SET) < 0)
msg_fatal("seek %s: %m", VSTREAM_PATH(source_fp));
/*
}
if (rec_type == REC_TYPE_ERROR)
msg_fatal("uid=%ld: malformed input", (long) uid);
- if (strchr(*expected, rec_type) == 0)
+ if (rec_type == 0 || strchr(*expected, rec_type) == 0)
msg_fatal("uid=%ld: unexpected record type: %d", (long) uid, rec_type);
if (rec_type == **expected)
expected++;
* recoverable error.
*/
for (;;) {
+ /* 202606 Qualys+Mythos: don't swap 'offset' and 'whence'. */
if (dict_isjmp(mkmap->dict) != 0
&& dict_setjmp(mkmap->dict) != 0
- && vstream_fseek(source_fp, SEEK_SET, 0) < 0)
+ && vstream_fseek(source_fp, 0, SEEK_SET) < 0)
msg_fatal("seek %s: %m", VSTREAM_PATH(source_fp));
/*
stat = vstream_pclose(showq);
}
argv_free(argv);
- myfree(showq_path);
+ /* 202606 Qualys+Mythos: don't free() text before logging. */
if (stat != 0)
msg_fatal_status(stat < 0 ? EX_OSERR : EX_SOFTWARE,
"Error running %s", showq_path);
+ myfree(showq_path);
}
/*
if (three_digs != 0) {
rdata.code = atoi(STR(session->buffer));
if (strchr("245", STR(session->buffer)[0]) != 0) {
- for (cp = STR(session->buffer) + 4; *cp == ' '; cp++)
+ /* 202606 Qualys+Mythos: start loop immediately after 'ddd'. */
+ for (cp = STR(session->buffer) + 3; *cp == ' '; cp++)
/* void */ ;
if ((len = dsn_valid(cp)) > 0 && *cp == *STR(session->buffer)) {
vstring_strncpy(rdata.dsn_buf, cp, len);
state->xforward.helo_name = 0;
state->xforward.ident = 0;
state->xforward.domain = 0;
+ /* 202606 Qualys+Mythos: future proofing. */
+ state->xforward.rfc_addr = 0;
}
/* smtpd_xforward_preset - set xforward attributes to "unknown" */
}
raw = vstring_alloc(ilen / 2);
if (hex_decode_opt(raw, cp, ilen, HEX_DECODE_FLAG_ALLOW_COLON) == 0) {
- myfree(raw);
+ /* 202606 Qualys+Mythos: vstring_free(), not myfree(). */
+ vstring_free(raw);
msg_warn("malformed fingerprint value: %.384s", values->argv[i]);
continue;
}
#define FREE_AND_RETURN(ptr, x) { vstring_free(ptr); return (x); }
bin_data = vstring_alloc(hex_data_len / 2 + 1);
- if (hex_decode_opt(bin_data, hex_data, hex_data_len,
- HEX_DECODE_FLAG_ALLOW_COLON) == 0) {
+ /* 202606 Qualys+Mythos: disallow ':', enforce hex_encode() format. */
+ if (hex_decode(bin_data, hex_data, hex_data_len) == 0) {
msg_warn("%s TLS cache: malformed entry for %s: %.100s",
cp->cache_label, cache_id, hex_data);
FREE_AND_RETURN(bin_data, 0);
"utf8_request", DICT_FLAG_UTF8_REQUEST, /* request UTF-8 activation */
"utf8_active", DICT_FLAG_UTF8_ACTIVE, /* UTF-8 is activated */
"src_rhs_is_file", DICT_FLAG_SRC_RHS_IS_FILE, /* value from file */
+ "surrogate", DICT_FLAG_SURROGATE, /* surrogate dictionary */
0,
};
#define DICT_FLAG_UTF8_ACTIVE (1<<20) /* UTF-8 proxy layer is present */
#define DICT_FLAG_SRC_RHS_IS_FILE \
(1<<21) /* Map source RHS is a file */
-#define DICT_FLAG_SURROGATE (1<22) /* This is a surrogate dictionary */
+#define DICT_FLAG_SURROGATE (1<<22) /* This is a surrogate dictionary */
#define DICT_FLAG_UTF8_MASK (DICT_FLAG_UTF8_REQUEST)
vstring_sprintf(buf, "Unknown error %d", err);
return (vstring_str(buf));
} else {
- return (sys_errlist[errno]);
+ /* 202606 Qualys+Mythos: use err, not errno. */
+ return (sys_errlist[err]);
}
}
vp->vbuf.flags = 0;
vp->vbuf.len = 0;
vp->vbuf.data = (unsigned char *) str;
- vp->vbuf.len = len + 1;
+ /* 202606 Qualys+Mythos: do not count the null terminator. */
+ vp->vbuf.len = len;
VSTRING_AT_OFFSET(vp, len);
vp->vbuf.get_ready = vstring_buf_get_ready;
vp->vbuf.put_ready = vstring_buf_put_ready;