Use memmove instead of memcpy. Fixes coverity complaint.
authorAlan T. DeKok <aland@freeradius.org>
Mon, 1 Sep 2014 14:37:03 +0000 (10:37 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 1 Sep 2014 14:37:03 +0000 (10:37 -0400)
But doesn't change anything, because "hdr_len" is always a small
value.  It's just not checked as such, so coverity doesn't pick up
on it

src/lib/radius.c

index 0a40682..3bd6b25 100644 (file)
@@ -1041,7 +1041,7 @@ static ssize_t attr_shift(uint8_t const *start, uint8_t const *end,
 
                len -= sublen;
                memmove(ptr + 255 + hdr_len, ptr + 255, sublen);
-               memcpy(ptr + 255, ptr, hdr_len);
+               memmove(ptr + 255, ptr, hdr_len);
                ptr[1] += sublen;
                if (vsa_offset) ptr[vsa_offset] += sublen;
                ptr[flag_offset] |= 0x80;