fa0e2fef8f
least one highly critical (remote). See http://secunia.com/advisories/29000 for details. Thanks to kurt@ for helping analyzing the threaded code issues.
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
$OpenBSD: patch-clamdscan_client_c,v 1.9 2008/04/16 19:46:01 mbalmer Exp $
|
|
--- clamdscan/client.c.orig Wed Apr 2 22:17:13 2008
|
|
+++ clamdscan/client.c Mon Apr 14 18:41:12 2008
|
|
@@ -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>
|
|
@@ -233,18 +234,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;
|
|
}
|