e2e2236f4d
Note to -stable ports maintainers: This should probably be put into -stable since the ClamAV people do not provide virus data to outdated scan engines. ok simon
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
$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 <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/socket.h>
|
|
+#include <sys/param.h>
|
|
#include <sys/un.h>
|
|
#include <netinet/in.h>
|
|
#include <arpa/inet.h>
|
|
@@ -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;
|
|
}
|