]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Make _fr_dbuff_init() and FR_DBUFF_TMP() set the buff field (#3837)
authorJames Jones <jejones3141@gmail.com>
Thu, 7 Jan 2021 01:26:21 +0000 (19:26 -0600)
committerGitHub <noreply@github.com>
Thu, 7 Jan 2021 01:26:21 +0000 (01:26 +0000)
src/lib/util/dbuff.h

index b35697e922a4a823869af526e380a6383703d484..e6be4598fee34f8befc69d6e50c5cc3f9cf8eed4 100644 (file)
@@ -334,6 +334,7 @@ static inline void _fr_dbuff_init(fr_dbuff_t *out, uint8_t const *start, uint8_t
        if (unlikely(end < start)) end = start; /* Could be an assert? */
 
        *out = (fr_dbuff_t){
+               .buff_i = start,
                .start_i = start,
                .p_i = start,
                .end_i = end,
@@ -490,6 +491,7 @@ static inline fr_dbuff_t *fr_dbuff_init_fd(fr_dbuff_t *dbuff, fr_dbuff_uctx_fd_t
  */
 #define FR_DBUFF_TMP(_start, _len_or_end) \
 (fr_dbuff_t){ \
+       .buff_i         = (uint8_t const *)(_start), \
        .start_i        = (uint8_t const *)(_start), \
        .end_i          = _Generic((_len_or_end), \
                                size_t          : (uint8_t const *)(_start) + (size_t)(_len_or_end), \