~ubuntu-branches/ubuntu/wily/maradns/wily-proposed

« back to all changes in this revision

Viewing changes to deadwood-3.2.07/update/3.2.04/deadwood-3.2.03-DwDnsStr-init0.patch

  • Committer: Package Import Robot
  • Author(s): Dariusz Dwornikowski, Tomasz Buchert, Dariusz Dwornikowski
  • Date: 2015-03-27 18:34:08 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20150327183408-wnfachdkdjt96yu6
Tags: 2.0.11-1
[ Tomasz Buchert ]
* Imported Upstream version 2.0.11

[ Dariusz Dwornikowski ]
* d/patches: 
  - refreshed all patches for new deadwood version
  - removed generating of random prime on build (Closes: #785536) 
* d/rules: date taken from changelog (Closes: #785535)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- deadwood-3.2.04/src/DwDnsStr.c.orig 2013-12-03 03:13:36.000000000 -0500
 
2
+++ deadwood-3.2.04/src/DwDnsStr.c      2013-12-03 03:56:49.000000000 -0500
 
3
@@ -1,4 +1,4 @@
 
4
-/* Copyright (c) 2009-2012 Sam Trenholme
 
5
+/* Copyright (c) 2009-2013 Sam Trenholme
 
6
  *
 
7
  * TERMS
 
8
  *
 
9
@@ -33,14 +33,36 @@
 
10
 dns_string *dwc_init_dns_str(int32_t ancount, int32_t nscount,
 
11
                 int32_t arcount) {
 
12
         dns_string *out = 0;
 
13
+       int a;
 
14
 
 
15
         out = dw_malloc(sizeof(dns_string));
 
16
         if(out == 0 || ancount < 0 || nscount < 0 || arcount < 0) {
 
17
                 return 0;
 
18
         }
 
19
         out->an = dw_malloc((ancount * sizeof(uint16_t) * 2) + 2);
 
20
+       if(out->an != 0) {
 
21
+               for(a = 0; a < (ancount * 2); a++) {
 
22
+                       out->an[a] = 0;
 
23
+               }
 
24
+       } else if(ancount > 0) {
 
25
+               return 0;
 
26
+       }
 
27
         out->ns = dw_malloc((nscount * sizeof(uint16_t) * 2) + 2);
 
28
+       if(out->ns != 0) {
 
29
+               for(a = 0; a < (nscount * 2); a++) {
 
30
+                       out->ns[a] = 0;
 
31
+               }
 
32
+       } else if(nscount > 0) {
 
33
+               return 0;
 
34
+       }
 
35
         out->ar = dw_malloc((arcount * sizeof(uint16_t) * 2) + 2);
 
36
+       if(out->ar != 0) {
 
37
+               for(a = 0; a < (arcount * 2); a++) {
 
38
+                       out->ar[a] = 0;
 
39
+               }
 
40
+       } else if(arcount > 0) {
 
41
+               return 0;
 
42
+       }
 
43
         out->packet = 0;
 
44
         out->ancount = ancount;
 
45
         out->nscount = nscount;