From 1708cc306cd67288df1a5b00d7e5d4b2ceecb62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 2 Apr 2006 00:22:08 +0000 Subject: [PATCH] (krb5_addlog_dest): make string length match strings in strcasecmp. Found by IBM checker. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16928 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/krb5/log.c b/lib/krb5/log.c index 89c963ec3..5674b1b1b 100644 --- a/lib/krb5/log.c +++ b/lib/krb5/log.c @@ -284,7 +284,7 @@ krb5_addlog_dest(krb5_context context, krb5_log_facility *f, const char *orig) ret = open_file(context, f, min, max, NULL, NULL, stderr, 1); }else if(strcmp(p, "CONSOLE") == 0){ ret = open_file(context, f, min, max, "/dev/console", "w", NULL, 0); - }else if(strncmp(p, "FILE:", 4) == 0 && (p[4] == ':' || p[4] == '=')){ + }else if(strncmp(p, "FILE", 4) == 0 && (p[4] == ':' || p[4] == '=')){ char *fn; FILE *file = NULL; int keep_open = 0; @@ -313,7 +313,7 @@ krb5_addlog_dest(krb5_context context, krb5_log_facility *f, const char *orig) keep_open = 1; } ret = open_file(context, f, min, max, fn, "a", file, keep_open); - }else if(strncmp(p, "DEVICE=", 6) == 0){ + }else if(strncmp(p, "DEVICE", 6) == 0 && (p[6] == ':' || p[6] == '=')){ ret = open_file(context, f, min, max, strdup(p + 7), "w", NULL, 0); }else if(strncmp(p, "SYSLOG", 6) == 0 && (p[6] == '\0' || p[6] == ':')){ char severity[128] = "";