Package: gsmartcontrol
Version: 0.8.7-2
Tags: patch

--- Please enter the report below this line. ---
Dear maintainer,
it appears that the problem was indeed that gsmartcontrol tried to parse the empty section which smartmontools 6.2 outputs for SMART-incapable devices.
I'm proposing the patch attached
This patch solved the crash for me, and allowed me to correctly detect which devices were SMART-capable and which were not.
Regards

--- System information. ---
Architecture: amd64
Kernel: Linux 3.11.8-desktop-f

Debian Release: jessie/sid
900 testing ftp.nluug.nl
900 solydxk ftp.nluug.nl
900 solydxk community.solydxk.com
850 testing debian.fastweb.it
800 unstable debian.fastweb.it
750 experimental debian.fastweb.it
500 wheezy linux.dropbox.com
500 home:ksmanis download.opensuse.org
400 testing debian.linuxmint.com
400 debian packages.linuxmint.com

--- Package information. ---
Depends (Version) | Installed
=====================================-+-==============
libatk1.0-0 (>= 1.12.4) | 2.10.0-2
libatkmm-1.6-1 (>= 2.22.1) | 2.22.7-2
libc6 (>= 2.14) |
libcairo2 (>= 1.2.4) |
libcairomm-1.0-1 (>= 1.6.4) |
libfontconfig1 (>= 2.11) |
libfreetype6 (>= 2.2.1) |
libgcc1 (>= 1:4.1.1) |
libgdk-pixbuf2.0-0 (>= 2.22.0) |
libglib2.0-0 (>= 2.16.0) |
libglibmm-2.4-1c2a (>= 2.36.2) |
libgtk2.0-0 (>= 2.8.0) |
libgtkmm-2.4-1c2a (>= 1:2.24.0) |
libpango-1.0-0 (>= 1.14.0) |
libpangocairo-1.0-0 (>= 1.14.0) |
libpangoft2-1.0-0 (>= 1.14.0) |
libpangomm-1.4-1 (>= 2.27.1) |
libpcre3 (>= 8.10) |
libsigc++-2.0-0c2a (>= 2.0.2) |
libstdc++6 (>= 4.6) |
smartmontools |
menu |


Package's Recommends field is empty.

Package's Suggests field is empty.



Description: don't try to parse empty sections
 Since smartmontools 6.0, the output is divided in sections regardless of the
 drive having or not SMART capabilities; in the latter case the last section
 is empty. In that case, just skip it (parsing empty sections causes a crash).
Author: Francesco Presel <f.pre...@alice.it>
Bug-Debian: http://bugs.debian.org/722989
Last-Update: <2014-01-23>

--- a/src/applib/smartctl_parser.cpp
+++ b/src/applib/smartctl_parser.cpp
@@ -202,7 +202,10 @@
 			&& (section_start_pos = s.find("===", section_start_pos)) != std::string::npos) {
 
 		tmp_pos = s.find("\n", section_start_pos);  // works with \r\n too.
-
+		if (tmp_pos == std::string::npos) { // empty section: skip
+			break;
+		}
+			
 		// trim is needed to remove potential \r in the end
 		std::string section_header = hz::string_trim_copy(s.substr(section_start_pos,
 				(tmp_pos == std::string::npos ? tmp_pos : (tmp_pos - section_start_pos)) ));
gsmartcontrol (0.8.7-2) UNRELEASED; urgency=medium

  * Compatibility with smartmontools 6.2
    Closes: #722989

 -- Francesco Presel <f.pre...@alice.it>  Wed, 22 Jan 2014 23:07:15 +0100

gsmartcontrol (0.8.7-1) unstable; urgency=low

  * [314881d] Updated debian/watch
  * [18ebada] Imported Upstream version 0.8.7
  * [c2a1f1b] debian/rules: Provide build-arch and build-indep
  * [d3036a4] Enabled Hardening Options
  * [2edfb87] Refreshed patches and removed patches apllied upstream
  * [ac3b953] Bump to standard versions 3.9.4
  * [292c276] Remove quilt from depends

 -- Giuseppe Iuculano <iucul...@debian.org>  Fri, 31 May 2013 11:41:52 +0200

gsmartcontrol (0.8.6-1.2) unstable; urgency=low

  * Non-maintainer upload.
  * Fix "ftbfs with GCC-4.7": add patch 05_gcc-4.7.patch from Paul Tagliamonte
    (adds this-> qualifier).
    Closes: #667194

 -- gregor herrmann <gre...@debian.org>  Sun, 22 Apr 2012 14:32:59 +0200

gsmartcontrol (0.8.6-1.1) unstable; urgency=low

  * Non-maintainer upload.
  * Fix "FTBFS with glib 2.32": add patch 04_glib2.31.patch from Alexander
    Shaduri. (Closes: #665677, LP: #935155

 -- gregor herrmann <gre...@debian.org>  Sun, 08 Apr 2012 14:19:47 +0200

gsmartcontrol (0.8.6-1) unstable; urgency=low

  * [dbb993d] Updated my email address and removed DM-Upload-Allowed
    control field
  * [b681b5b] Imported Upstream version 0.8.6
  * [ab9bb7a] Refreshed patches
  * [a909506] Bump to Standards-Version 3.9.2, no changes needed
  * [48dd13d] Switch to dpkg-source 3.0 (quilt) format

 -- Giuseppe Iuculano <iucul...@debian.org>  Fri, 15 Jul 2011 14:59:29 +0200

gsmartcontrol (0.8.5-2) unstable; urgency=low

  * [8240961] Add menu in Depends (Closes: #548232) (LP: #438394)

 -- Giuseppe Iuculano <giuse...@iuculano.it>  Tue, 29 Sep 2009 23:04:43 +0200

gsmartcontrol (0.8.5-1) unstable; urgency=low

  * [7f4b7f6] Imported Upstream version 0.8.5
  * [51d2a10] Refreshed patches
  * [8c6daef] Updated to Standards-Version 3.8.3 (no changes needed)
  * [30bc489] Added a README.source

 -- Giuseppe Iuculano <giuse...@iuculano.it>  Tue, 15 Sep 2009 09:52:00 +0200

gsmartcontrol (0.8.4-2) unstable; urgency=low

  * [d6e1ccc] debian/patches/03_gcc4.4.patch: Added a missing include
    and fix FTBFS with GCC 4.4 (Closes: #525734)

 -- Giuseppe Iuculano <giuse...@iuculano.it>  Mon, 11 May 2009 12:43:43 +0200

gsmartcontrol (0.8.4-1) unstable; urgency=low

  * [56eb25b] Fix a typo in the previous changeleg entry
  * [74046f6] New Upstream Version 0.8.4
  * [8fdb261] debian/patches/03_blacklist_md_devices.patch: Removed
  * [bdbe2af] debian/rules: Do not install debian/gsmartcontrol.1, now
    it is in upstream
  * [62c0daa] Updated watch file
  * [bc779d0] debian/rules: use dh_auto_configure
  * [07120d7] Updated to standards version 3.8.1 (No changes needed)

 -- Giuseppe Iuculano <giuse...@iuculano.it>  Thu, 26 Mar 2009 23:18:40 +0100

gsmartcontrol (0.8.3-3) unstable; urgency=low

  * [7468f7c] debian/control: Fix Vcs-Browser field
  * [5c94558] debian/gsmartcontrol.1: gsmartcontrol supports quite a
    number of options, added to manpage. Thanks Alexander Shaduri
  * [f8e620b] debian/gsmartcontrol-root: The gsmartcontrol-root script
    was incompatible with the original one, which uses the first
    argument for desktop selection. Fixed, thanks Alexander Shaduri
  * [10861d9] debian/copyright: gsmartcontrol is released under either
    GPL 2 or GPL 3 but not any other version, so point to both of the
    specific versions of the GPL that the package license references and
    fix copyright-refers-to-versionless-license-file lintian warning.

 -- Giuseppe Iuculano <giuse...@iuculano.it>  Wed, 04 Feb 2009 12:18:06 +0100

gsmartcontrol (0.8.3-2) unstable; urgency=low

  * [2cc4a61] debian/rules: Do not use --enable-optimize-options in
    configure, and fix FTBFS

 -- Giuseppe Iuculano <giuse...@iuculano.it>  Sun, 01 Feb 2009 12:13:20 +0100

gsmartcontrol (0.8.3-1) unstable; urgency=low

  * Initial release (Closes: #508512)
  * debian/patches/01_use_su-to-root.patch: use su-to-root instead of upstream
    gsmartcontrol-root script
  * debian/patches/02_fix_doc_install.patch: Do not install doc and license
    files
  * debian/patches/03_blacklist_md_devices.patch: do not scan /dev/md[0-9]
    devices

 -- Giuseppe Iuculano <giuse...@iuculano.it>  Mon, 29 Dec 2008 09:57:37 +0100

Reply via email to