Expand buffer to max string size
authorAlan T. DeKok <aland@freeradius.org>
Mon, 13 Apr 2015 16:43:49 +0000 (12:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 13 Apr 2015 16:44:15 +0000 (12:44 -0400)
src/modules/rlm_logintime/timestr.c

index c90e471..5c85f29 100644 (file)
@@ -176,10 +176,9 @@ static int day_fill(char *bitmap, const char *tm)
 static int week_fill(char *bitmap, char *tm)
 {
        char *s;
-       char tmp[128];
+       char tmp[256];
 
-       strlcpy(tmp, tm, 128);
-       tmp[127] = 0;
+       strlcpy(tmp, tm, sizeof(tmp));
        for (s = tmp; *s; s++)
                if (isupper(*s)) *s = tolower(*s);