diff -upk.orig scrollkeeper-0.3.14.orig/libs/database.c scrollkeeper-0.3.14/libs/database.c --- scrollkeeper-0.3.14.orig/libs/database.c 2002-06-02 06:03:10 +0000 +++ scrollkeeper-0.3.14/libs/database.c 2007-06-26 12:34:52 +0000 @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -27,9 +28,6 @@ #include #include -#define PATHLEN 256 - - /* * Create a directory. Send errors to appropriate places (STDOUT and log * file) according to command-line flags. @@ -55,7 +53,7 @@ static int sk_mkdir(char *path, mode_t o */ int sk_mkdir_with_parents(char *fullpath, mode_t options, char outputprefs) { - char path[1024]; + char path[PATH_MAX]; char slash[]="/"; char delim[]="/"; char *token, *pathcopy; @@ -63,15 +61,16 @@ int sk_mkdir_with_parents(char *fullpath pathcopy = strdup(fullpath); /* Copy b/c strtok edits the string it operates on */ path[0] = '\0'; /* Initialize with end of string null character */ - if (pathcopy[0] == slash[0]) sprintf(path, "/"); /* preserve any starting slash */ + if (pathcopy[0] == slash[0]) strcpy(path, "/"); /* preserve any starting slash */ token = strtok (pathcopy, delim); delim[0]=slash[0]; while(token != NULL) { if (strlen(path) == 0 || ((strlen(path) == 1) && (path[0] == slash[0]))) { - sprintf(path, "%s%s", path, token); + strncat(path, token, sizeof(path) - 1); } else { - sprintf(path, "%s/%s", path, token); + strncat(path, "/", sizeof(path) - 1); + strncat(path, token, sizeof(path) - 1); } if (stat(path, &buf) == -1) { if (sk_mkdir(path, options, outputprefs) != 0) { diff -upk.orig scrollkeeper-0.3.14.orig/libs/install.c scrollkeeper-0.3.14/libs/install.c --- scrollkeeper-0.3.14.orig/libs/install.c 2003-09-03 10:33:52 +0000 +++ scrollkeeper-0.3.14/libs/install.c 2007-06-26 12:34:11 +0000 @@ -32,7 +32,6 @@ #define _(String) gettext (String) #define SEP "|" -#define PATHLEN 256 #ifdef SOLARIS /*extern char *strtok_r(char *, const char *, char **);*/ diff -upk.orig scrollkeeper-0.3.14.orig/libs/scrollkeeper.h.in scrollkeeper-0.3.14/libs/scrollkeeper.h.in --- scrollkeeper-0.3.14.orig/libs/scrollkeeper.h.in 2003-06-23 09:00:44 +0000 +++ scrollkeeper-0.3.14/libs/scrollkeeper.h.in 2007-06-26 12:34:11 +0000 @@ -32,7 +32,7 @@ #define SCROLLKEEPERLOGFILE "@localstatedir@/log/scrollkeeper.log" #define SCROLLKEEPERLOGFILE_ROT "@localstatedir@/log/scrollkeeper.log.1" #define SCROLLKEEPER_OMF_DTD "@prefix@/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd" -#define PATHLEN 256 +#define PATHLEN PATH_MAX /* * diff -upk.orig scrollkeeper-0.3.14.orig/libs/uninstall.c scrollkeeper-0.3.14/libs/uninstall.c --- scrollkeeper-0.3.14.orig/libs/uninstall.c 2003-12-02 08:09:56 +0000 +++ scrollkeeper-0.3.14/libs/uninstall.c 2007-06-26 12:34:11 +0000 @@ -29,8 +29,6 @@ #define _(String) gettext (String) -#define PATHLEN 256 - struct IdTab { int id; char *locale;