1
--- deadwood-3.0.02/src/DwUdpSocket.c 2011-01-29 14:55:10.000000000 -0600
2
+++ deadwood-3.0.03/src/DwUdpSocket.c 2011-07-08 14:29:39.083168916 -0500
4
-/* Copyright (c) 2007-2010 Sam Trenholme and others
5
+/* Copyright (c) 2007-2011 Sam Trenholme and others
12
/* Make the actual answer for a synthetic "not there" reply */
13
-unsigned char *make_synth_not_there_answer(unsigned char *a, int count,
14
+unsigned char *make_synth_not_there_answer(unsigned char *a, int *count,
16
/* This is the answer for a "not there" reply */
17
unsigned char not_there[41] =
19
unsigned char *answer = 0;
22
- answer = malloc(count + 43);
23
+ answer = malloc(*count + 43);
30
/* Copy the header they sent us to our reply */
31
- for(counter = 0; counter < 12 && counter < count; counter++) {
32
+ for(counter = 0; counter < 12 && counter < *count; counter++) {
33
answer[counter] = a[counter];
36
/* Copy the question over to the reply */
37
- for(;counter < 520 && counter < count; counter++) {
38
+ for(;counter < 520 && counter < *count; counter++) {
40
break; /* Quick and dirty "end of name"; yes, I
41
* check in dw_get_dname_type() to make sure
44
answer[counter] = a[counter];
46
- if(count < counter + 5 || counter > 512) { /* Sanity check */
47
+ if(*count < counter + 5 || counter > 512) { /* Sanity check */
52
/* Add the rest of the question */
53
- count = counter + 5;
54
- for(;counter < count; counter++) {
55
+ *count = counter + 5;
56
+ for(;counter < *count; counter++) {
57
answer[counter] = a[counter];
60
/* Add the SOA reply to the answer */
61
for(counter = 0; counter < 40; counter++) {
62
- answer[count + counter] = not_there[counter];
63
+ answer[*count + counter] = not_there[counter];
66
/* Return the answer */
70
/* Copy original header and question in to answer */
71
- answer = make_synth_not_there_answer(a,count,0);
72
+ answer = make_synth_not_there_answer(a,&count,0);
76
--- deadwood-3.0.02/src/DwSocket.h 2011-01-29 14:55:10.000000000 -0600
77
+++ deadwood-3.0.03/src/DwSocket.h 2011-07-08 14:29:44.619736989 -0500
79
#endif /* NO_INET_PTON */
81
/* Make the actual answer for a synthetic "not there" reply */
82
-unsigned char *make_synth_not_there_answer(unsigned char *a, int count,
83
+unsigned char *make_synth_not_there_answer(unsigned char *a, int *count,
86
#endif /* __DW_SOCKET_DEFINED__ */
87
--- deadwood-3.0.03/src/DwRecurse.c.orig 2011-07-08 14:39:06.243401567 -0500
88
+++ deadwood-3.0.03/src/DwRecurse.c 2011-07-08 14:39:47.383379806 -0500
89
@@ -1528,13 +1528,14 @@
91
dw_str *dwx_synth_notthere(dw_str *query) {
95
/*dw_px("Empty reply, making synth nothere\n");*//*DEBUG*/
96
hack = malloc(sizeof(dw_str));
100
- hack->str = (uint8_t *)make_synth_not_there_answer(0,20,1);
101
+ hack->str = (uint8_t *)make_synth_not_there_answer(0,&l,1);