From a07431a9795cf93ab77002e9aa8d0e9805147077 Mon Sep 17 00:00:00 2001 From: Janusz Kozerski Date: Mon, 28 Oct 2013 14:44:05 +0100 Subject: [PATCH] Fix value returned by smack_label_length() In some cases smack_label_length have returned 0 on incorrect label. Now smack_label_length() always returns -1 in case of incorrect label. (cherry picked from commit f7e4232a319b269f6214af660173eebaa605ad9e) --- libsmack/libsmack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsmack/libsmack.c b/libsmack/libsmack.c index e1b8668..fb4fab3 100644 --- a/libsmack/libsmack.c +++ b/libsmack/libsmack.c @@ -728,7 +728,7 @@ static int smack_label_length(const char *label) int i; if (!label || label[0] == '\0' || label[0] == '-') - return 0; + return -1; for (i = 0; i < (SMACK_LABEL_LEN + 1) && label[i]; i++) { switch (label[i]) { -- 2.7.4