ports/126338: ports-mgmt/pkg_cleanup segfault

Shota Iwazaki iwazaki8 at yahoo.co.jp
Thu Aug 7 15:20:04 UTC 2008


>Number:         126338
>Category:       ports
>Synopsis:       ports-mgmt/pkg_cleanup segfault
>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:   Thu Aug 07 15:20:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Shota Iwazaki
>Release:        8.0-CURRENT
>Organization:
>Environment:
FreeBSD truth.robust.dip.jp 8.0-CURRENT FreeBSD 8.0-CURRENT #2: Sat Aug  2 11:44:11 JST 2008     root at truth.robust.dip.jp:/usr/obj/usr/src/sys/TRUTH  i386
>Description:
pkg_cleanup segfault when I deleted devel/m17n-lib and other ports which is required by devel/m17n-lib.

The argument of malloc is wrong in pkg_cleanup.c.
>How-To-Repeat:
1. Install devel/m17n-lib, converters/fribidi, graphics/gd, print/libotf, devel/m17n-db.
2. Run pkg_cleanup.
3. Mark m17n-lib for removal.
4. Select [OK]
5. Select [YES]
6. Mark fribidi, gd, libotf and m17n-db for removal.
7. Select [OK]
8. Select [YES]
9. pkg_cleanup segfault.
>Fix:
diff -ru pkg_cleanup.orig/Makefile pkg_cleanup/Makefile
--- pkg_cleanup.orig/Makefile   2008-08-07 23:00:30.001854757 +0900
+++ pkg_cleanup/Makefile        2008-08-08 00:10:45.657793903 +0900
@@ -7,6 +7,7 @@

 PORTNAME=      pkg_cleanup
 PORTVERSION=   1.0
+PORTREVISION=  1
 CATEGORIES=    ports-mgmt
 DISTFILES=

diff -ru pkg_cleanup.orig/files/pkg_cleanup.c pkg_cleanup/files/pkg_cleanup.c
--- pkg_cleanup.orig/files/pkg_cleanup.c        2008-08-07 23:00:29.991460605 +0900
+++ pkg_cleanup/files/pkg_cleanup.c     2008-08-08 00:10:45.657793903 +0900
@@ -208,7 +208,7 @@
        pid_t   child;
        int             status;

-       args=(char **)malloc(menulen+2 * sizeof(char *));
+       args=(char **)malloc((menulen+2) * sizeof(char *));
        if(!args) {
                init_dialog();
                dialog_msgbox("ERROR", "Can not allocate memory for package list!", 5, 45, TRUE);

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list