~ubuntu-branches/ubuntu/raring/maradns/raring

« back to all changes in this revision

Viewing changes to deadwood-3.0.05/update/3.0.03/deadwood-3.0.02-correct_synth_not_there_len.patch

  • Committer: Package Import Robot
  • Author(s): Nicholas Bamber
  • Date: 2011-11-21 22:10:46 UTC
  • mfrom: (1.1.16) (10.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20111121221046-vtngcxq5dbywexin
Tags: 1.4.07-1
* Made watch file handle recursive lookups
* New upstream release (Closes: #607739)
* Added lintian override concerning DEP-5
* Added README.source concerning #643043
* Added patch updating upstream changelog
* Updated TODO.Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
3
@@ -1,4 +1,4 @@
 
4
-/* Copyright (c) 2007-2010 Sam Trenholme and others
 
5
+/* Copyright (c) 2007-2011 Sam Trenholme and others
 
6
  *
 
7
  * TERMS
 
8
  *
 
9
@@ -850,7 +850,7 @@
 
10
 }
 
11
 
 
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,
 
15
                 int type) {
 
16
         /* This is the answer for a "not there" reply */
 
17
         unsigned char not_there[41] =
 
18
@@ -865,7 +865,7 @@
 
19
         unsigned char *answer = 0;
 
20
         int counter = 0;
 
21
 
 
22
-        answer = malloc(count + 43);
 
23
+        answer = malloc(*count + 43);
 
24
         if(answer == 0) {
 
25
                 return 0;
 
26
         }
 
27
@@ -878,12 +878,12 @@
 
28
         }
 
29
 
 
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];
 
34
         }
 
35
 
 
36
         /* Copy the question over to the reply */
 
37
-        for(;counter < 520 && counter < count; counter++) {
 
38
+        for(;counter < 520 && counter < *count; counter++) {
 
39
                 if(a[counter] == 0) {
 
40
                         break; /* Quick and dirty "end of name"; yes, I
 
41
                                 * check in dw_get_dname_type() to make sure
 
42
@@ -891,20 +891,20 @@
 
43
                 }
 
44
                 answer[counter] = a[counter];
 
45
         }
 
46
-        if(count < counter + 5 || counter > 512) { /* Sanity check */
 
47
+        if(*count < counter + 5 || counter > 512) { /* Sanity check */
 
48
                 free(answer);
 
49
                 return 0;
 
50
         }
 
51
 
 
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];
 
58
         }
 
59
 
 
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];
 
64
         }
 
65
 
 
66
         /* Return the answer */
 
67
@@ -921,7 +921,7 @@
 
68
         }
 
69
 
 
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);
 
73
         if(answer == 0) {
 
74
                 return;
 
75
         }
 
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
 
78
@@ -378,7 +378,7 @@
 
79
 #endif /* NO_INET_PTON */
 
80
 
 
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,
 
84
                 int type);
 
85
 
 
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 @@
 
90
 
 
91
 dw_str *dwx_synth_notthere(dw_str *query) {
 
92
         dw_str *hack, *out;
 
93
+       int l = 20;
 
94
 
 
95
         /*dw_px("Empty reply, making synth nothere\n");*//*DEBUG*/
 
96
         hack = malloc(sizeof(dw_str));
 
97
         if(hack == 0) {
 
98
                 return 0;
 
99
         }
 
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);
 
102
         hack->len = 40;
 
103
         hack->sane = 114;
 
104
         hack->max = 59;