diff options
Diffstat (limited to 'web/attachments/420256-check_snmp_64bit_fix.diff')
-rw-r--r-- | web/attachments/420256-check_snmp_64bit_fix.diff | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/web/attachments/420256-check_snmp_64bit_fix.diff b/web/attachments/420256-check_snmp_64bit_fix.diff new file mode 100644 index 0000000..78bf767 --- /dev/null +++ b/web/attachments/420256-check_snmp_64bit_fix.diff | |||
@@ -0,0 +1,155 @@ | |||
1 | *** check_snmp.c Thu Aug 4 14:33:54 2011 | ||
2 | --- check_snmp_64bit_fix.c Thu Aug 4 14:17:49 2011 | ||
3 | *************** | ||
4 | *** 85,91 **** | ||
5 | |||
6 | int process_arguments (int, char **); | ||
7 | int validate_arguments (void); | ||
8 | ! char *thisarg (char *str); | ||
9 | char *nextarg (char *str); | ||
10 | void print_usage (void); | ||
11 | void print_help (void); | ||
12 | --- 85,91 ---- | ||
13 | |||
14 | int process_arguments (int, char **); | ||
15 | int validate_arguments (void); | ||
16 | ! char *trimstring (char *str); | ||
17 | char *nextarg (char *str); | ||
18 | void print_usage (void); | ||
19 | void print_help (void); | ||
20 | *************** | ||
21 | *** 180,187 **** | ||
22 | bindtextdomain (PACKAGE, LOCALEDIR); | ||
23 | textdomain (PACKAGE); | ||
24 | |||
25 | ! labels = malloc (labels_size); | ||
26 | ! unitv = malloc (unitv_size); | ||
27 | for (i = 0; i < MAX_OIDS; i++) | ||
28 | eval_method[i] = CHECK_UNDEF; | ||
29 | |||
30 | --- 180,187 ---- | ||
31 | bindtextdomain (PACKAGE, LOCALEDIR); | ||
32 | textdomain (PACKAGE); | ||
33 | |||
34 | ! labels = malloc (sizeof(char *) * labels_size); | ||
35 | ! unitv = malloc (sizeof(char *) * unitv_size); | ||
36 | for (i = 0; i < MAX_OIDS; i++) | ||
37 | eval_method[i] = CHECK_UNDEF; | ||
38 | |||
39 | *************** | ||
40 | *** 737,760 **** | ||
41 | nlabels++; | ||
42 | if (nlabels >= labels_size) { | ||
43 | labels_size += 8; | ||
44 | ! labels = realloc (labels, labels_size); | ||
45 | if (labels == NULL) | ||
46 | die (STATE_UNKNOWN, _("Could not reallocate labels[%d]"), (int)nlabels); | ||
47 | } | ||
48 | ! labels[nlabels - 1] = optarg; | ||
49 | ! ptr = thisarg (optarg); | ||
50 | labels[nlabels - 1] = ptr; | ||
51 | if (strstr (ptr, "'") == ptr) | ||
52 | labels[nlabels - 1] = ptr + 1; | ||
53 | while (ptr && (ptr = nextarg (ptr))) { | ||
54 | if (nlabels >= labels_size) { | ||
55 | labels_size += 8; | ||
56 | ! labels = realloc (labels, labels_size); | ||
57 | if (labels == NULL) | ||
58 | die (STATE_UNKNOWN, _("Could not reallocate labels\n")); | ||
59 | } | ||
60 | labels++; | ||
61 | ! ptr = thisarg (ptr); | ||
62 | if (strstr (ptr, "'") == ptr) | ||
63 | labels[nlabels - 1] = ptr + 1; | ||
64 | else | ||
65 | --- 738,760 ---- | ||
66 | nlabels++; | ||
67 | if (nlabels >= labels_size) { | ||
68 | labels_size += 8; | ||
69 | ! labels = realloc (labels, sizeof(char *) * labels_size); | ||
70 | if (labels == NULL) | ||
71 | die (STATE_UNKNOWN, _("Could not reallocate labels[%d]"), (int)nlabels); | ||
72 | } | ||
73 | ! ptr = trimstring (optarg); | ||
74 | labels[nlabels - 1] = ptr; | ||
75 | if (strstr (ptr, "'") == ptr) | ||
76 | labels[nlabels - 1] = ptr + 1; | ||
77 | while (ptr && (ptr = nextarg (ptr))) { | ||
78 | if (nlabels >= labels_size) { | ||
79 | labels_size += 8; | ||
80 | ! labels = realloc (labels, sizeof(char *) * labels_size); | ||
81 | if (labels == NULL) | ||
82 | die (STATE_UNKNOWN, _("Could not reallocate labels\n")); | ||
83 | } | ||
84 | labels++; | ||
85 | ! ptr = trimstring (ptr); | ||
86 | if (strstr (ptr, "'") == ptr) | ||
87 | labels[nlabels - 1] = ptr + 1; | ||
88 | else | ||
89 | *************** | ||
90 | *** 766,789 **** | ||
91 | nunits++; | ||
92 | if (nunits >= unitv_size) { | ||
93 | unitv_size += 8; | ||
94 | ! unitv = realloc (unitv, unitv_size); | ||
95 | if (unitv == NULL) | ||
96 | die (STATE_UNKNOWN, _("Could not reallocate units [%d]\n"), (int)nunits); | ||
97 | } | ||
98 | ! unitv[nunits - 1] = optarg; | ||
99 | ! ptr = thisarg (optarg); | ||
100 | unitv[nunits - 1] = ptr; | ||
101 | if (strstr (ptr, "'") == ptr) | ||
102 | unitv[nunits - 1] = ptr + 1; | ||
103 | while (ptr && (ptr = nextarg (ptr))) { | ||
104 | if (nunits >= unitv_size) { | ||
105 | unitv_size += 8; | ||
106 | ! unitv = realloc (unitv, unitv_size); | ||
107 | if (units == NULL) | ||
108 | die (STATE_UNKNOWN, _("Could not realloc() units\n")); | ||
109 | } | ||
110 | nunits++; | ||
111 | ! ptr = thisarg (ptr); | ||
112 | if (strstr (ptr, "'") == ptr) | ||
113 | unitv[nunits - 1] = ptr + 1; | ||
114 | else | ||
115 | --- 766,788 ---- | ||
116 | nunits++; | ||
117 | if (nunits >= unitv_size) { | ||
118 | unitv_size += 8; | ||
119 | ! unitv = realloc (unitv, sizeof(char *) * unitv_size); | ||
120 | if (unitv == NULL) | ||
121 | die (STATE_UNKNOWN, _("Could not reallocate units [%d]\n"), (int)nunits); | ||
122 | } | ||
123 | ! ptr = trimstring (optarg); | ||
124 | unitv[nunits - 1] = ptr; | ||
125 | if (strstr (ptr, "'") == ptr) | ||
126 | unitv[nunits - 1] = ptr + 1; | ||
127 | while (ptr && (ptr = nextarg (ptr))) { | ||
128 | if (nunits >= unitv_size) { | ||
129 | unitv_size += 8; | ||
130 | ! unitv = realloc (unitv, sizeof(char *) * unitv_size); | ||
131 | if (units == NULL) | ||
132 | die (STATE_UNKNOWN, _("Could not realloc() units\n")); | ||
133 | } | ||
134 | nunits++; | ||
135 | ! ptr = trimstring (ptr); | ||
136 | if (strstr (ptr, "'") == ptr) | ||
137 | unitv[nunits - 1] = ptr + 1; | ||
138 | else | ||
139 | *************** | ||
140 | *** 936,942 **** | ||
141 | if there is a leading quote, make sure it balances */ | ||
142 | |||
143 | char * | ||
144 | ! thisarg (char *str) | ||
145 | { | ||
146 | str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ | ||
147 | if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */ | ||
148 | --- 935,941 ---- | ||
149 | if there is a leading quote, make sure it balances */ | ||
150 | |||
151 | char * | ||
152 | ! trimstring (char *str) | ||
153 | { | ||
154 | str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ | ||
155 | if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */ | ||