summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2014-09-14 17:32:27 +0300
committerRichard Hughes <richard@hughsie.com>2014-09-16 10:33:56 +0100
commit33a3af8008520f472727bf2144bae9a7585bc53e (patch)
treeef832cfd92ea67003774cd87dfd367a754a81fa3
parent081c35a36c9becea28698ac73ef5b31045fc3973 (diff)
downloadupower-33a3af8008520f472727bf2144bae9a7585bc53e.tar.gz
Fencepost array access error
Array 'temp_data[100]' accessed at index 100, which is out of bounds. https://bugs.freedesktop.org/show_bug.cgi?id=71066 Signed-off-by: Richard Hughes <richard@hughsie.com>
-rw-r--r--src/up-wakeups.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/up-wakeups.c b/src/up-wakeups.c
index a0719e1..38b8870 100644
--- a/src/up-wakeups.c
+++ b/src/up-wakeups.c
@@ -283,8 +283,8 @@ up_strsplit_complete_set (const gchar *string, const gchar *delimiters, guint ma
/* find length of string */
len = &string[i] - start;
- if (len > 100)
- len = 100;
+ if (len > 99)
+ len = 99;
strncpy (temp_data, start, len);
temp_data[len] = '\0';