Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Jan 2016 10:55:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 205796] [patch] math/xgraph - fix two Segmentation fault problems
Message-ID:  <bug-205796-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-205796-13>