From: Alan T. DeKok Date: Mon, 16 May 2011 12:21:34 +0000 (+0200) Subject: Fix issues bound by clang X-Git-Tag: release_3_0_0_beta0~825 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=646afab48f4b733c33cad73e78619102016aae5b;p=thirdparty%2Ffreeradius-server.git Fix issues bound by clang --- diff --git a/src/lib/radius.c b/src/lib/radius.c index 33a9c30e069..8bdb9fd58f6 100644 --- a/src/lib/radius.c +++ b/src/lib/radius.c @@ -219,7 +219,6 @@ void rad_print_hex(RADIUS_PACKET *packet) } else { ptr += 2; total -= 2; - vendor = 0; } print_hex_data(ptr, attrlen, 3); @@ -739,12 +738,12 @@ static ssize_t vp2data_tlvs(const RADIUS_PACKET *packet, ssize_t len; size_t my_room; uint8_t *ptr = start; - const VALUE_PAIR *old_vp; const VALUE_PAIR *vp = *pvp; const VALUE_PAIR *svp = vp; -#ifndef NDEBUG + if (!svp) return 0; +#ifndef NDEBUG if (nest > fr_attr_max_tlv) { fr_strerror_printf("vp2data_tlvs: attribute nesting overflow"); return -1; @@ -754,7 +753,6 @@ static ssize_t vp2data_tlvs(const RADIUS_PACKET *packet, while (vp) { if (room < 2) return ptr - start; - old_vp = vp; ptr[0] = (vp->attribute >> fr_attr_shift[nest]) & fr_attr_mask[nest]; ptr[1] = 2; @@ -895,7 +893,6 @@ static ssize_t vp2data_any(const RADIUS_PACKET *packet, fr_strerror_printf("ERROR: Cannot encode NULL TLV"); return -1; } - len = vp->length; break; default: /* unknown type: ignore it */