From owner-freebsd-ports-bugs@freebsd.org Sat Jan 2 10:55:21 2016 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DC76A5F4E8 for ; Sat, 2 Jan 2016 10:55:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33370152C for ; Sat, 2 Jan 2016 10:55:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u02AtKUY086323 for ; Sat, 2 Jan 2016 10:55:21 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 205796] [patch] math/xgraph - fix two Segmentation fault problems Date: Sat, 02 Jan 2016 10:55:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: uratan@miomio.jp X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: sanpei@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jan 2016 10:55:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205796 Bug ID: 205796 Summary: [patch] math/xgraph - fix two Segmentation fault problems Product: Ports & Packages Version: Latest Hardware: amd64 OS: Any Status: New Keywords: patch Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: sanpei@FreeBSD.org Reporter: uratan@miomio.jp Assignee: sanpei@FreeBSD.org Keywords: patch Flags: maintainer-feedback?(sanpei@FreeBSD.org) Created attachment 164950 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D164950&action= =3Dedit patchs, xgraph.c for problem-[1], xtb.h for problem-[2] [1] uninitialized pointer access in main() problem: Simply execute xgraph, it may make Segmentation fault. description: When calling init_X() from main(), an uninitilized pointer 'win_info' is referenced. This may cause Segmentation fault according to its stack condition. workaround: Function init_X() will not use its parameter now, so simply remove the reference, see patch for xgraph.c. [2] variable argument problem about xtb_vert(), xtb_hort(), when amd64 problem: When openning Hardcopy dialog, on amd64 environment, Segmentation fault will occur. description: Function xtb_vert() / xtb_hort() accept pointers by variable argument, and use mere 0 (defined as 'NE') for its end-of-list value. On amd64 environment, mere 0 is passed as a 4-byte-param (because it is an int value), but above functions take the params out as a pointer (8-byte at amd64), so end-of-list value is packed with some more 4-byte garbage and lost, it will make later Segmentation fault. workaround: To make the end-of-list value to 8-byte one, add a cast to the macro 'NE', see patch for xtb.h. This change will not have a bad influence for i386 or other environment, I wish... - * - * - testing environment: +------------------------------------ |% uname -srm |FreeBSD 10.2-RELEASE amd64 | | |% head /usr/ports/math/xgraph/Makefile |# Created by: asami |# $FreeBSD: tags/RELEASE_10_2_0/math/xgraph/Makefile 376508 2015-01-08 01:23:17Z | sanpei $ | |PORTNAME=3D xgraph |PORTVERSION=3D 11.3.2.20000910 |PORTREVISION=3D 3 |CATEGORIES=3D math print |MASTER_SITES=3D ftp://ftp.cs.utoronto.ca/pub/radford/ |DISTNAME=3D xgraph-11 +------------------------------------ --=20 You are receiving this mail because: You are the assignee for the bug.=