* Add a check that prevents the server from seg faulting if
authorhartwick <hartwick>
Tue, 13 Mar 2001 17:35:43 +0000 (17:35 +0000)
committerhartwick <hartwick>
Tue, 13 Mar 2001 17:35:43 +0000 (17:35 +0000)
  row[0] happens to be NULL.

src/modules/rlm_sql/rlm_sql.c

index bf312e5..94cf3c4 100644 (file)
@@ -321,6 +321,12 @@ static int rlm_sql_authenticate(void *instance, REQUEST * request) {
                return RLM_MODULE_REJECT;
        }
 
+       /* If this is a null the server will seg fault */
+       if (row[0] == NULL) {
+               radlog(L_ERR, "rlm_sql_authenticate: row[0] returned null.");
+               return RLM_MODULE_REJECT;
+       }
+
        /*
         * Just compare the two 
         */