Fix up some DNS packet boundary checking

This commit is contained in:
alexhudson
2007-09-06 16:28:06 +00:00
parent bf0efbcb3e
commit 204abc232d
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -2018,8 +2018,8 @@ DeliverSMTPMessage (ConnectionStruct * Client, unsigned char *Sender,
continue;
}
else {
Log(LOG_INFO, "Message failed delivery from %s to %s Flags %d Status %d",
Sender, Recips[i].To, Client->Flags, status);
Log(LOG_INFO, "Message failed delivery from %s to %s Flags %d Status %d: %s",
Sender, Recips[i].To, Client->Flags, status, Reply);
if (status == 550) {
Recips[i].Result = DELIVER_USER_UNKNOWN;
if ((unsigned long) ResultLen > strlen (Reply)) {
@@ -2281,7 +2281,6 @@ DeliverRemoteMessage (ConnectionStruct * Client, unsigned char *Sender,
goto finish;
}
// TODO: honour max MX server setting
while ((list = XplDnsNextMxLookupIpList(mx)) != NULL) {
int x;
@@ -2325,6 +2324,7 @@ DeliverRemoteMessage (ConnectionStruct * Client, unsigned char *Sender,
if (RetVal == DELIVER_SUCCESS) {
goto finish;
}
// TODO: Should take into account max MX setting here
if (RetVal == DELIVER_FAILURE) {
goto finish;
}
+2 -2
View File
@@ -394,7 +394,7 @@ _XplDns_ParseQuery(const char *answer_buffer, int answer_len, XplDns_Result *res
XplDns_RecordList *item;
char answer_domain[XPLDNS_NAMELEN + 1];
item = MemMalloc(sizeof(XplDns_RecordList));
item = MemMalloc(sizeof(XplDns_RecordList));
answer_domain[0] = '\0';
res = _XplDns_ParseName(answer_buffer, answer_len,
@@ -461,7 +461,7 @@ _XplDns_ParseQuery(const char *answer_buffer, int answer_len, XplDns_Result *res
}
response += ntohs(dns_answer->size);
if (response >= response_end) return;
if (response > response_end) return;
}
// don't make the result 'success' until we've really done everything