summaryrefslogtreecommitdiff
path: root/compat.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2015-08-19 14:23:51 +0100
committerColin Watson <cjwatson@debian.org>2015-08-19 16:48:11 +0100
commit0f0841b2d28b7463267d4d91577e72e3340a1d3a (patch)
treeba55fcd2b6e2cc22b30f5afb561dbb3da4c8b6c7 /compat.c
parentf2a5f5dae656759efb0b76c3d94890b65c197a02 (diff)
parent8698446b972003b63dfe5dcbdb86acfe986afb85 (diff)
New upstream release (6.8p1).
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/compat.c b/compat.c
index 4d286e8e9..4852fb709 100644
--- a/compat.c
+++ b/compat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: compat.c,v 1.85 2014/04/20 02:49:32 djm Exp $ */ 1/* $OpenBSD: compat.c,v 1.87 2015/01/19 20:20:20 markus Exp $ */
2/* 2/*
3 * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -57,7 +57,7 @@ enable_compat13(void)
57 compat13 = 1; 57 compat13 = 1;
58} 58}
59/* datafellows bug compatibility */ 59/* datafellows bug compatibility */
60void 60u_int
61compat_datafellows(const char *version) 61compat_datafellows(const char *version)
62{ 62{
63 int i; 63 int i;
@@ -174,13 +174,14 @@ compat_datafellows(const char *version)
174 for (i = 0; check[i].pat; i++) { 174 for (i = 0; check[i].pat; i++) {
175 if (match_pattern_list(version, check[i].pat, 175 if (match_pattern_list(version, check[i].pat,
176 strlen(check[i].pat), 0) == 1) { 176 strlen(check[i].pat), 0) == 1) {
177 datafellows = check[i].bugs;
178 debug("match: %s pat %s compat 0x%08x", 177 debug("match: %s pat %s compat 0x%08x",
179 version, check[i].pat, datafellows); 178 version, check[i].pat, check[i].bugs);
180 return; 179 datafellows = check[i].bugs; /* XXX for now */
180 return check[i].bugs;
181 } 181 }
182 } 182 }
183 debug("no match: %s", version); 183 debug("no match: %s", version);
184 return 0;
184} 185}
185 186
186#define SEP "," 187#define SEP ","
@@ -192,7 +193,9 @@ proto_spec(const char *spec)
192 193
193 if (spec == NULL) 194 if (spec == NULL)
194 return ret; 195 return ret;
195 q = s = xstrdup(spec); 196 q = s = strdup(spec);
197 if (s == NULL)
198 return ret;
196 for ((p = strsep(&q, SEP)); p && *p != '\0'; (p = strsep(&q, SEP))) { 199 for ((p = strsep(&q, SEP)); p && *p != '\0'; (p = strsep(&q, SEP))) {
197 switch (atoi(p)) { 200 switch (atoi(p)) {
198 case 1: 201 case 1:
@@ -234,7 +237,7 @@ filter_proposal(char *proposal, const char *filter)
234 debug2("Compat: skipping algorithm \"%s\"", cp); 237 debug2("Compat: skipping algorithm \"%s\"", cp);
235 } 238 }
236 buffer_append(&b, "\0", 1); 239 buffer_append(&b, "\0", 1);
237 fix_prop = xstrdup(buffer_ptr(&b)); 240 fix_prop = xstrdup((char *)buffer_ptr(&b));
238 buffer_free(&b); 241 buffer_free(&b);
239 free(orig_prop); 242 free(orig_prop);
240 243