$OpenBSD: patch-clamdscan_client_c,v 1.7 2007/08/25 10:08:28 mbalmer Exp $ --- clamdscan/client.c.orig Sat Mar 31 20:59:16 2007 +++ clamdscan/client.c Sat Aug 25 09:35:06 2007 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -286,18 +287,18 @@ static int dsstream(int sockd, const struct optstruct static char *abpath(const char *filename) { struct stat foo; - char *fullpath, cwd[200]; + char *fullpath, cwd[MAXPATHLEN]; if(stat(filename, &foo) == -1) { logg("^Can't access file %s\n", filename); perror(filename); return NULL; } else { - fullpath = malloc(200 + strlen(filename) + 10); + fullpath = malloc(sizeof(cwd) + strlen(filename) + 10); #ifdef C_CYGWIN sprintf(fullpath, "%s", filename); #else - if(!getcwd(cwd, 200)) { + if(!getcwd(cwd, MAXPATHLEN)) { logg("^Can't get absolute pathname of current working directory.\n"); return NULL; }