X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/52f12a7cec769b679305bb9ba23534dfd155d46a..b2734f7b45111f9b7de790c7b334a2ece47675b5:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index 0edd95dff..2c290251d 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1957,7 +1957,7 @@ switch (vp->type) case vtype_pspace: { int inodes; - sprintf(CS var_buffer, "%d", + sprintf(CS var_buffer, PR_EXIM_ARITH, receive_statvfs(val == (void *)TRUE, &inodes)); } return var_buffer; @@ -3901,7 +3901,8 @@ return NULL; /* Pull off the leading array or object element, returning a copy in an allocated string. Update the list pointer. -The element may itself be an abject or array. +The element may itself be an object or array. +Return NULL when the list is empty. */ uschar * @@ -3923,6 +3924,7 @@ for (item = s; case '}': object_depth--; break; } *list = *s ? s+1 : s; +if (item == s) return NULL; item = string_copyn(item, s - item); DEBUG(D_expand) debug_printf_indent(" json ele: '%s'\n", item); return US item; @@ -4814,7 +4816,7 @@ while (*s != 0) (void)sscanf(CS now,"%u",&inow); (void)sscanf(CS daystamp,"%u",&iexpire); - /* When "iexpire" is < 7, a "flip" has occured. + /* When "iexpire" is < 7, a "flip" has occurred. Adjust "inow" accordingly. */ if ( (iexpire < 7) && (inow >= 993) ) inow = 0; @@ -5790,10 +5792,11 @@ while (*s != 0) } while (field_number > 0 && (item = json_nextinlist(&list))) field_number--; - s = item; - lookup_value = s; - while (*s) s++; - while (--s >= lookup_value && isspace(*s)) *s = '\0'; + if ((lookup_value = s = item)) + { + while (*s) s++; + while (--s >= lookup_value && isspace(*s)) *s = '\0'; + } } else { @@ -7490,7 +7493,7 @@ while (*s != 0) continue; } - /* Handle time period formating */ + /* Handle time period formatting */ case EOP_TIME_EVAL: {