diff options
Diffstat (limited to 'lib/dns/rdata.c')
-rw-r--r-- | lib/dns/rdata.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 3865f42fe086..c85b64d462f7 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -279,7 +279,7 @@ locator_pton(const char *src, unsigned char *dst) { } if (tp != endp) return (0); - memcpy(dst, tmp, NS_LOCATORSZ); + memmove(dst, tmp, NS_LOCATORSZ); return (1); } @@ -320,7 +320,7 @@ mem_maybedup(isc_mem_t *mctx, void *source, size_t length) { return (source); new = isc_mem_allocate(mctx, length); if (new != NULL) - memcpy(new, source, length); + memmove(new, source, length); return (new); } @@ -500,7 +500,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, dns_rdataclass_t rdclass, isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; - size_t length; + unsigned int length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -587,7 +587,7 @@ dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_availableregion(target, &tr); if (tr.length < rdata->length) return (ISC_R_NOSPACE); - memcpy(tr.base, rdata->data, rdata->length); + memmove(tr.base, rdata->data, rdata->length); isc_buffer_add(target, rdata->length); return (ISC_R_SUCCESS); } @@ -681,7 +681,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass, unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; - size_t length; + unsigned int length; isc_boolean_t unknown; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); @@ -908,7 +908,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, dns_rdataclass_t rdclass, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; - size_t length; + unsigned int length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -1171,7 +1171,7 @@ txt_totext(isc_region_t *source, isc_buffer_t *target) { return (ISC_R_NOSPACE); *tp++ = '"'; tl--; - isc_buffer_add(target, tp - (char *)region.base); + isc_buffer_add(target, (unsigned int)(tp - (char *)region.base)); isc_region_consume(source, *source->base + 1); return (ISC_R_SUCCESS); } @@ -1237,7 +1237,7 @@ txt_fromtext(isc_textregion_t *source, isc_buffer_t *target) { } if (escape) return (DNS_R_SYNTAX); - *tregion.base = t - tregion.base - 1; + *tregion.base = (unsigned char)(t - tregion.base - 1); isc_buffer_add(target, *tregion.base + 1); return (ISC_R_SUCCESS); } @@ -1260,7 +1260,7 @@ txt_fromwire(isc_buffer_t *source, isc_buffer_t *target) { return (ISC_R_NOSPACE); if (tregion.base != sregion.base) - memcpy(tregion.base, sregion.base, n); + memmove(tregion.base, sregion.base, n); isc_buffer_forward(source, n); isc_buffer_add(target, n); return (ISC_R_SUCCESS); @@ -1318,7 +1318,7 @@ multitxt_totext(isc_region_t *source, isc_buffer_t *target) { return (ISC_R_NOSPACE); *tp++ = '"'; tl--; - isc_buffer_add(target, tp - (char *)region.base); + isc_buffer_add(target, (unsigned int)(tp - (char *)region.base)); return (ISC_R_SUCCESS); } @@ -1382,7 +1382,7 @@ multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target) { } if (escape) return (DNS_R_SYNTAX); - *t0 = t - t0 - 1; + *t0 = (unsigned char)(t - t0 - 1); isc_buffer_add(target, *t0 + 1); } while (n != 0); return (ISC_R_SUCCESS); @@ -1409,7 +1409,7 @@ multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target) { if (n > tregion.length) return (ISC_R_NOSPACE); - memcpy(tregion.base, sregion.base, n); + memmove(tregion.base, sregion.base, n); isc_buffer_forward(source, n); isc_buffer_add(target, n); isc_buffer_activeregion(source, &sregion); @@ -1460,7 +1460,7 @@ str_totext(const char *source, isc_buffer_t *target) { if (l > region.length) return (ISC_R_NOSPACE); - memcpy(region.base, source, l); + memmove(region.base, source, l); isc_buffer_add(target, l); return (ISC_R_SUCCESS); } @@ -1586,7 +1586,7 @@ mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) { if (length > tr.length) return (ISC_R_NOSPACE); if (tr.base != base) - memcpy(tr.base, base, length); + memmove(tr.base, base, length); isc_buffer_add(target, length); return (ISC_R_SUCCESS); } @@ -1604,7 +1604,7 @@ hexvalue(char value) { c = tolower(c); if ((s = strchr(hexdigits, c)) == NULL) return (-1); - return (s - hexdigits); + return (int)(s - hexdigits); } static int @@ -1619,7 +1619,7 @@ decvalue(char value) { return (-1); if ((s = strchr(decdigits, value)) == NULL) return (-1); - return (s - decdigits); + return (int)(s - decdigits); } static const char atob_digits[86] = @@ -1679,15 +1679,15 @@ byte_atob(int c, isc_buffer_t *target, struct state *state) { } } else if ((s = strchr(atob_digits, c)) != NULL) { if (bcount == 0) { - word = s - atob_digits; + word = (isc_int32_t)(s - atob_digits); ++bcount; } else if (bcount < 4) { word = times85(word); - word += s - atob_digits; + word += (isc_int32_t)(s - atob_digits); ++bcount; } else { word = times85(word); - word += s - atob_digits; + word += (isc_int32_t)(s - atob_digits); RETERR(putbyte((word >> 24) & 0xff, target, state)); RETERR(putbyte((word >> 16) & 0xff, target, state)); RETERR(putbyte((word >> 8) & 0xff, target, state)); |