Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE
freeradius-server.7382
21e2e95.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 21e2e95.patch of Package freeradius-server.7382
commit 21e2e95751bfb54c0fb0328392d06671a75c191c Author: Alan T. DeKok <aland@freeradius.org> Date: Mon Jul 3 15:37:44 2017 -0400 FR-GV-303 - do memchr() of end-p, not q-p diff --git a/src/modules/proto_dhcp/dhcp.c b/src/modules/proto_dhcp/dhcp.c index a66a931cb..dbfe81747 100644 --- a/src/modules/proto_dhcp/dhcp.c +++ b/src/modules/proto_dhcp/dhcp.c @@ -774,25 +774,23 @@ static int fr_dhcp_attr2vp(TALLOC_CTX *ctx, VALUE_PAIR **vp_p, uint8_t const *da * multiple additional VPs */ fr_cursor_init(&cursor, vp_p); - for (;;) { - q = memchr(p, '\0', q - p); + while (p < end) { + q = memchr(p, '\0', end - p); /* Malformed but recoverable */ if (!q) q = end; fr_pair_value_bstrncpy(vp, (char const *)p, q - p); p = q + 1; + if (p >= end) break; + /* Need another VP for the next round */ - if (p < end) { - vp = fr_pair_afrom_da(ctx, vp->da); - if (!vp) { - fr_pair_list_free(vp_p); - return -1; - } - fr_cursor_insert(&cursor, vp); - continue; + vp = fr_pair_afrom_da(ctx, vp->da); + if (!vp) { + fr_pair_list_free(vp_p); + return -1; } - break; + fr_cursor_insert(&cursor, vp); } } break;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor