[devhelp] Book: set_enabled(): sanitize gboolean input
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] Book: set_enabled(): sanitize gboolean input
- Date: Sun, 10 Dec 2017 10:55:08 +0000 (UTC)
commit 076d735875887778b7d9528671fd9512ff8ea741
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Dec 10 11:46:30 2017 +0100
Book: set_enabled(): sanitize gboolean input
It's especially important since priv->enabled is a bit field in the
struct.
src/dh-book.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-book.c b/src/dh-book.c
index c009e97..fbe8b23 100644
--- a/src/dh-book.c
+++ b/src/dh-book.c
@@ -551,6 +551,9 @@ dh_book_set_enabled (DhBook *book,
g_return_if_fail (DH_IS_BOOK (book));
priv = dh_book_get_instance_private (book);
+
+ enabled = enabled != FALSE;
+
if (priv->enabled != enabled) {
priv->enabled = enabled;
g_signal_emit (book,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]