Skip to content

Commit

Permalink
fix dnsquery.cc里面数组的越界写问题 review by @ElvisWu
Browse files Browse the repository at this point in the history
  • Loading branch information
elviswu authored and garryyan committed Oct 24, 2017
1 parent ab582b3 commit 66d6693
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mars/sdt/src/checkimpl/dnsquery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void ReadRecvAnswer(unsigned char* _buf, struct DNS_HEADER* _dns, unsigned char*
_reader = _reader + sizeof(struct R_DATA);

if (ntohs(_answers[i].resource->type) == 1) { // if its an ipv4 address
_answers[i].rdata = (unsigned char*)malloc(ntohs(_answers[i].resource->data_len));
_answers[i].rdata = (unsigned char*)malloc(ntohs(_answers[i].resource->data_len)+1);

if (NULL == _answers[i].rdata) {
xerror2(TSF"answer error.");
Expand Down

0 comments on commit 66d6693

Please sign in to comment.