2016-12-27 22:25:14 +01:00
|
|
|
From 8416d8a1a423535fbc5d4e7416d6eac8ac5c050b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Preston Maness <aggroskater@gmail.com>
|
|
|
|
Date: Tue, 26 Apr 2016 23:06:57 -0500
|
|
|
|
Subject: [PATCH] Fix #1530 (null pointer dereference)
|
2017-09-03 12:14:15 +02:00
|
|
|
X-Patch-added-by: Jan Engelhardt <jengelh@inai.de>
|
|
|
|
X-Patch-added-on: 2016-12-27 21:25:14 +0000
|
2016-12-27 22:25:14 +01:00
|
|
|
|
|
|
|
---
|
2017-09-03 00:47:48 +02:00
|
|
|
client/hostinfo_unix.cpp | 9 +++++----
|
2016-12-27 22:25:14 +01:00
|
|
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
|
|
|
|
2017-09-03 12:14:15 +02:00
|
|
|
Index: boinc-client_release-7.6-7.6.33/client/hostinfo_unix.cpp
|
2017-09-03 00:47:48 +02:00
|
|
|
===================================================================
|
2017-09-03 12:14:15 +02:00
|
|
|
--- boinc-client_release-7.6-7.6.33.orig/client/hostinfo_unix.cpp
|
|
|
|
+++ boinc-client_release-7.6-7.6.33/client/hostinfo_unix.cpp
|
2017-09-03 00:47:48 +02:00
|
|
|
@@ -1989,11 +1989,12 @@ const vector<string> X_display_values_in
|
2016-12-27 22:25:14 +01:00
|
|
|
"[idle_detection] Error (%d) opening %s.", errno, dir.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-
|
|
|
|
- while ((dirp = readdir(dp)) != NULL) {
|
|
|
|
- display_values.push_back(string(dirp->d_name));
|
|
|
|
+ else {
|
|
|
|
+ while ((dirp = readdir(dp)) != NULL) {
|
|
|
|
+ display_values.push_back(string(dirp->d_name));
|
|
|
|
+ }
|
|
|
|
+ closedir(dp);
|
|
|
|
}
|
|
|
|
- closedir(dp);
|
|
|
|
|
|
|
|
// Get rid of non-matching elements and format the matching ones.
|
|
|
|
for ( it = display_values.begin() ; it != display_values.end() ; ) {
|