From 3f02bc8c168c973014436823104a85d264870946 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Mon, 17 Mar 2014 21:29:59 +0000 Subject: [PATCH] Increment p *then* set last full attribute pointer. Fixes #550 --- src/modules/rlm_rest/rest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/rlm_rest/rest.c b/src/modules/rlm_rest/rest.c index c79f704..32648cd 100644 --- a/src/modules/rlm_rest/rest.c +++ b/src/modules/rlm_rest/rest.c @@ -518,18 +518,18 @@ static size_t rest_encode_post(void *ptr, size_t size, size_t nmemb, void *userd if (!--s) goto no_space; - - /* - * We wrote one full attribute value pair, record progress. - */ - f = p; - /* * there are more attributes, insert a separator */ if (fr_cursor_next(&ctx->cursor)) { *p++ = '&'; } + + /* + * We wrote one full attribute value pair, record progress. + */ + f = p; + ctx->state = READ_STATE_ATTR_BEGIN; } -- 2.1.4