Bug 167938 - [PATCH] net/p5-IO-Interface: fix incorrect pointer usage
Summary: [PATCH] net/p5-IO-Interface: fix incorrect pointer usage
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: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-15 21:30 UTC by Xin LI
Modified: 2012-05-15 21:50 UTC (History)
1 user (show)

See Also:


Attachments
p5-IO-Interface.diff (1.45 KB, patch)
2012-05-15 21:30 UTC, Xin LI
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xin LI freebsd_committer freebsd_triage 2012-05-15 21:30:01 UTC
	The current p5-IO-Interface code does an incorrect pointer usage,
basically:

     getifaddrs(&ifap);
     while (1) {
	(some handling)
	ifap = ifap -> ifa_next; <-- 1)
     }
     freeifaddrs(ifap); <--

	The freeifaddrs() will be passed with a potentionally different
pointer because of 1).

Fix: The proposed changeset saves the ifap pointer and call freeifaddrs()
with the saved one to avoid this problem.
How-To-Repeat: 	Call the function on latest -CURRENT.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-05-15 21:30:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->perl

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Xin LI freebsd_committer freebsd_triage 2012-05-15 21:48:20 UTC
State Changed
From-To: open->closed

Committed with approval from swills@ via IRC. 


Comment 3 Xin LI freebsd_committer freebsd_triage 2012-05-15 21:48:20 UTC
Responsible Changed
From-To: perl->delphij

Take.
Comment 4 dfilter service freebsd_committer freebsd_triage 2012-05-15 21:48:20 UTC
delphij     2012-05-15 20:48:06 UTC

  FreeBSD ports repository

  Modified files:
    net/p5-IO-Interface  Makefile 
  Added files:
    net/p5-IO-Interface/files patch-Interface.xs 
  Log:
  Fix an incorrect pointer usage and pass the right pointer to freeifaddrs(),
  which would cause a free() inside allocated chunk.
  
  Without this change, the class could crash with jemalloc debugging options
  enabled.  The patch have also been submitted to upstream maintainer.
  
  Reported by:    lev
  Submitted by:   delphij
  PR:             ports/167938
  Approved by:    perl@ (swills)
  
  Revision  Changes    Path
  1.13      +1 -0      ports/net/p5-IO-Interface/Makefile
  1.1       +27 -0     ports/net/p5-IO-Interface/files/patch-Interface.xs (new)
_______________________________________________
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"