From 025004599b5534dddb1c86f32e2b0e86b313c264 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Fri, 4 Mar 2016 22:52:57 -0500 Subject: [PATCH] Don't set value field to NULL --- src/modules/rlm_sql/sql.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/rlm_sql/sql.c b/src/modules/rlm_sql/sql.c index 76bf3da..e364fe5 100644 --- a/src/modules/rlm_sql/sql.c +++ b/src/modules/rlm_sql/sql.c @@ -115,7 +115,7 @@ int sql_fr_pair_list_afrom_str(TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR **h * Verify the 'Attribute' field */ if (!row[2] || row[2][0] == '\0') { - REDEBUG("The 'Attribute' field is empty or NULL, skipping the entire row"); + REDEBUG("Attribute field is empty or NULL, skipping the entire row"); return -1; } @@ -135,14 +135,18 @@ int sql_fr_pair_list_afrom_str(TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR **h * Complain about empty or invalid 'op' field */ op = T_OP_CMP_EQ; - REDEBUG("The 'op' field for attribute '%s = %s' is NULL, or non-existent.", row[2], row[3]); + REDEBUG("The op field for attribute '%s = %s' is NULL, or non-existent.", row[2], row[3]); REDEBUG("You MUST FIX THIS if you want the configuration to behave as you expect"); } /* * The 'Value' field may be empty or NULL */ - value = row[3]; + if (!row[3]) { + REDEBUG("Value field is empty or NULL, skipping the entire row"); + return -1; + } + /* * If we have a new-style quoted string, where the * *entire* string is quoted, do xlat's. @@ -165,9 +169,9 @@ int sql_fr_pair_list_afrom_str(TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR **h * Mark the pair to be allocated later. */ case T_BACK_QUOTED_STRING: - value = NULL; do_xlat = 1; - break; + + /* FALL-THROUGH */ /* * Keep the original string. -- 2.1.4