Skip to content

Commit

Permalink
Merge pull request #135 from jedisct1/bounds-check
Browse files Browse the repository at this point in the history
Bounds check
  • Loading branch information
cofyc authored Feb 16, 2018
2 parents 3cc443c + e5bf5a2 commit a2ce07e
Show file tree
Hide file tree
Showing 6 changed files with 356 additions and 328 deletions.
4 changes: 2 additions & 2 deletions dnscrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ dnscrypt_server_curve(struct context *c, const dnsccert *cert,
*/
int
dnscrypt_self_serve_cert_file(struct context *c, struct dns_header *header,
size_t *dns_query_len)
size_t *dns_query_len, size_t max_len)
{
unsigned char *p;
unsigned char *ansp;
Expand Down Expand Up @@ -438,7 +438,7 @@ dnscrypt_self_serve_cert_file(struct context *c, struct dns_header *header,

for (int i=0; i < c->signed_certs_count; i++) {
if (add_resource_record
(header, nameoffset, &ansp, 0, NULL, T_TXT, C_IN, "t", size,
(header, nameoffset, max_len, &ansp, 0, NULL, T_TXT, C_IN, "t", size,
*(txt + i))) {
anscount++;
} else {
Expand Down
2 changes: 1 addition & 1 deletion dnscrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,6 @@ int dnscrypt_server_curve(struct context *c, const dnsccert *cert,
* */
int dnscrypt_self_serve_cert_file(struct context *c,
struct dns_header *header,
size_t *dns_query_len);
size_t *dns_query_len, size_t max_len);

#endif
Loading

0 comments on commit a2ce07e

Please sign in to comment.