[network-manager-applet] editor: fix prefix validation for addresses, zero is not allowed



commit 1b47f453bdb95f56297f84d8902cd75f8d74fe75
Author: Jiří Klimeš <jklimes redhat com>
Date:   Tue Mar 3 14:33:14 2015 +0100

    editor: fix prefix validation for addresses, zero is not allowed

 src/connection-editor/page-ip4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c
index 6f1b48f..1b6d1d8 100644
--- a/src/connection-editor/page-ip4.c
+++ b/src/connection-editor/page-ip4.c
@@ -667,7 +667,7 @@ parse_netmask (const char *str, guint32 *prefix)
        /* Is it a prefix? */
        if (!strchr (str, '.')) {
                tmp_prefix = strtol (str, NULL, 10);
-               if (!errno && tmp_prefix >= 0 && tmp_prefix <= 32) {
+               if (!errno && tmp_prefix > 0 && tmp_prefix <= 32) {
                        *prefix = tmp_prefix;
                        return TRUE;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]