ports/166278: [patch] devel/libexecinfo: backtrace_symbols_fd() output some junk
Dmitrij Tejblum
tejblum at yandex-team.ru
Tue Mar 20 17:40:08 UTC 2012
>Number: 166278
>Category: ports
>Synopsis: [patch] devel/libexecinfo: backtrace_symbols_fd() output some junk
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Mar 20 17:40:07 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Dmitrij Tejblum
>Release: FreeBSD 8.2-STABLE
>Organization:
Yandex
>Environment:
>Description:
The function backtrace_symbols_fd() in the libexecinfo library allocates some buffer and the fill it with snprintf(). snprintf() leaves unused some space at the end of the buffer. Then backtrace_symbols_fd() output the whole buffer; it result in junk in the output.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
--- files/patch-execinfo.c 2008-11-26 18:23:25.000000000 +0300
+++ files/patch-execinfo.c 2012-03-20 21:07:56.000000000 +0400
@@ -54,3 +54,11 @@
return rval;
}
+@@ -155,6 +158,6 @@
+ return;
+ snprintf(buf, len, "%p\n", buffer[i]);
+ }
+- write(fd, buf, len - 1);
++ write(fd, buf, strlen(buf));
+ }
+ }
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list