Package: linux86
Version: 0.16.17-3
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu jaunty ubuntu-patch
Hi!
It looks like MAXPATHLEN is not being set to PATH_MAX (which is the buffer
size required by realpath()). This can lead to crashes, and was noticed on
Ubuntu where FORTIFY_SOURCE is enabled.
Attached patch fixes the definition.
Thanks!
-Kees
--
Kees Cook @debian.org
--- linux86-0.16.17.orig/bcc/bcc.c
+++ linux86-0.16.17/bcc/bcc.c
@@ -32,6 +32,7 @@
#ifndef MSDOS
#include <sys/wait.h>
#include <signal.h>
+#include <limits.h>
#endif
#include "version.h"
@@ -600,8 +601,12 @@
command_reset()
{
#ifndef MAXPATHLEN
+#ifdef PATH_MAX
+#define MAXPATHLEN PATH_MAX
+#else
#define MAXPATHLEN 1024
#endif
+#endif
char buf[MAXPATHLEN];
char ** prefix;
char * saved_cmd;
@@ -1308,11 +1313,7 @@
for(d=s=ptr; d && *s; s=d)
{
-#ifdef MAXPATHLEN
char buf[MAXPATHLEN];
-#else
- char buf[1024];
-#endif
free(temp);
d=strchr(s, ':');