Dear Maintainer,
The crash seems to be caused by an attempted string operation on a null pointer
in the function Gnome() in Sysinfo/SystemInfo.cs while parsing the file
/usr/share/gnome/gnome-version.xml.
There is no <date> tag in recent versions of the gnome-version.xml so the
variable
gnomeB is never set to true which causes the loop to run until the end of the
file
is reached and there is no check if textread.ReadLine() returns null before any
string operations are performed on the result.
Please have a look at the attached patch, which adds an additional condition to
the while loop if null is read from the file, which fixes the crash for me
(although it does not change the crude way used to parse the gnome-version.xml).
For reference there is a report for the same problem in ubuntu's bugtracker:
https://bugs.launchpad.net/ubuntu/+source/sysinfo/+bug/1575182/
--- a/Sysinfo/SystemInfo.cs
+++ b/Sysinfo/SystemInfo.cs
@@ -171,9 +171,7 @@
using (TextReader textread = File.OpenText(gnome_about)) {
- while ( gnomeB == false ) {
-
- temp = textread.ReadLine();
+ while ( (temp = textread.ReadLine()) != null && gnomeB == false ) {
//get version from xml
if ( temp.EndsWith("platform>")) {