Bug 126338 - ports-mgmt/pkg_cleanup segfault
Summary: ports-mgmt/pkg_cleanup segfault
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-07 16:20 UTC by Shota Iwazaki
Modified: 2008-08-11 20:50 UTC (History)
0 users

See Also:


Attachments
file.diff (312 bytes, patch)
2008-08-07 16:20 UTC, Shota Iwazaki
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shota Iwazaki 2008-08-07 16:20:03 UTC
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.

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



-       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);--f9paCVaU4jjk856v0jRddREVCrzgmbCkKpbeorOm4qVc4d1t
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

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 @@
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.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-08-07 16:20:11 UTC
Maintainer of ports-mgmt/pkg_cleanup,

Please note that PR ports/126338 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/126338

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2008-08-07 16:20:12 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Stephen Hurd freebsd_committer freebsd_triage 2008-08-08 04:34:40 UTC
Edwin Groothuis wrote:
> Maintainer of ports-mgmt/pkg_cleanup,
>
> Please note that PR ports/126338 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>   

I approve this patch.  Thanks!
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2008-08-08 09:49:45 UTC
State Changed
From-To: feedback->open

Maintainer approved.
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2008-08-11 20:31:02 UTC
Responsible Changed
From-To: freebsd-ports-bugs->amdmi3

I'll take it.
Comment 6 dfilter service freebsd_committer freebsd_triage 2008-08-11 20:46:58 UTC
amdmi3      2008-08-11 19:46:48 UTC

  FreeBSD ports repository

  Modified files:
    ports-mgmt/pkg_cleanup Makefile 
    ports-mgmt/pkg_cleanup/files pkg_cleanup.c 
  Log:
  - Fix segfaults due to typo in malloc() invocation
  
  PR:             ports/126338
  Submitted by:   Shota Iwazaki <iwazaki8 at yahoo dot co dot jp>
  Approved by:    Stephen Hurd <shurd at sasktel dot net> (maintainer)
  Approved by:    miwi (mentor implicit)
  
  Revision  Changes    Path
  1.2       +1 -0      ports/ports-mgmt/pkg_cleanup/Makefile
  1.2       +1 -1      ports/ports-mgmt/pkg_cleanup/files/pkg_cleanup.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 Dmitry Marakasov freebsd_committer freebsd_triage 2008-08-11 20:47:07 UTC
State Changed
From-To: open->closed

Committed. Thanks!