Bug 192630

Summary: [patch] databases/rrdtool: rrdupdate crash on amd64 systems
Product: Ports & Packages Reporter: Henry Hu <henry.hu.sh>
Component: Individual Port(s)Assignee: Niclas Zeising <zeising>
Status: Closed FIXED    
Severity: Affects Some People    
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
patch rrdupdate.c to fix the problem none

Description Henry Hu 2014-08-13 01:30:03 UTC
Created attachment 145745 [details]
patch rrdupdate.c to fix the problem

rrdupdate/rrdinfo in rrdtool crashes when executed.

The reason is that, in rrdupdate.c, basename() is used, but libgen.h is not included.
As a result, basename is implicitly declared. Its return type is considered as int, which only has 32 bits. On 64-bit systems, because its real return type is char*, the higher 32 bits would be cut off, and the return value is trashed.

The attached patch fixes this problem.

This has already been fixed upstream in
https://github.com/oetiker/rrdtool-1.x/commit/d0bd4217d9fb69db9f94363087936cf93fa9b4ea
But there is no release after that.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-08-13 05:53:40 UTC
over to maintainer for approval
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-08-30 19:01:25 UTC
A commit references this bug:

Author: zeising
Date: Sat Aug 30 19:01:17 UTC 2014
New revision: 366668
URL: http://svnweb.freebsd.org/changeset/ports/366668

Log:
  Fix runtime on amd64

  Sorry for the portrevision churn, forgot this with previous commit.

  PR:		192630
  Submitted by:	Henry Hu <henry.hu.sh@gmail.com>

Changes:
  head/databases/rrdtool/Makefile
  head/databases/rrdtool/files/patch-src__rrdupdate.c
Comment 3 Niclas Zeising freebsd_committer freebsd_triage 2014-08-30 19:01:48 UTC
Fixed, thanks!