X2Go Bug report logs - #777
nx-libs: incorrect usage of scanf

version graph

Package: nx-libs; Maintainer for nx-libs is X2Go Developers <x2go-dev@lists.x2go.org>;

Reported by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Date: Fri, 30 Jan 2015 19:40:01 UTC

Severity: normal

Found in version head

Done: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Bug is archived. No further changes may be made.

Full log

🔗 View this message in rfc822 format

X-Loop: owner@bugs.x2go.org
Subject: Bug#777: nx-libs: incorrect usage of scanf
Reply-To: Heinrich Schuchardt <xypron.glpk@gmx.de>, 777@bugs.x2go.org
Resent-From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Fri, 30 Jan 2015 19:40:01 +0000
Resent-Message-ID: <handler.777.B.14226465565953@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: report 777
X-X2Go-PR-Package: nx-libs
Received: via spool by submit@bugs.x2go.org id=B.14226465565953
          (code B); Fri, 30 Jan 2015 19:40:01 +0000
Received: (at submit) by bugs.x2go.org; 30 Jan 2015 19:35:56 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM
	autolearn=ham version=3.3.2
Received: from mout.gmx.net (mout.gmx.net [])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 5DD0C3BC8A
	for <submit@bugs.x2go.org>; Fri, 30 Jan 2015 20:35:55 +0100 (CET)
Received: from [] ([]) by mail.gmx.com (mrgmx102)
 with ESMTPSA (Nemesis) id 0MaE4a-1XxP3T0IOm-00JoiI for
 <submit@bugs.x2go.org>; Fri, 30 Jan 2015 20:35:55 +0100
Message-ID: <54CBDD19.8090103@gmx.de>
Date: Fri, 30 Jan 2015 20:35:53 +0100
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0
MIME-Version: 1.0
To: submit@bugs.x2go.org
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Provags-ID:  V03:K0:LBguQCVpS36vYsS5CVcFmYe4tyBsvIMCWaV5SEWlwYE+LjeXeCv
X-UI-Out-Filterresults: notjunk:1;
package: nx-libs
version: head

In different parts of the nx-libs library you can find usages of scanf like

   /* check for MESA_GAMMA environment variable */
   gamma = _mesa_getenv("MESA_GAMMA");
   if (gamma) {
      v->RedGamma = v->GreenGamma = v->BlueGamma = 0.0;
      sscanf( gamma, "%f %f %f", &v->RedGamma, &v->GreenGamma,
&v->BlueGamma );

According to cppcheck:

scanf without field width limits can crash with huge input data on libc
versions older than 2.13-25. Add a field width specifier to fix this
    %i => %3i

Best regards

Heinrich Schuchardt

Send a report that this bug log contains spam.

X2Go Developers <owner@bugs.x2go.org>. Last modified: Mon Jul 13 05:00:34 2020; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.