Clean up.
Signed-off-by: Chuck Lever <[email protected]>
---
src/libsi/getsrvinfo.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/libsi/getsrvinfo.c b/src/libsi/getsrvinfo.c
index 5338454..b60a915 100644
--- a/src/libsi/getsrvinfo.c
+++ b/src/libsi/getsrvinfo.c
@@ -206,7 +206,7 @@ insert_srvinfo_sorted(struct srvinfo **head, struct srvinfo
*entry)
int
getsrvinfo(const char *srvname, const char *domainname, struct srvinfo **si)
{
- unsigned char *msg, *comp_dn;
+ unsigned char *msg, *eom, *comp_dn;
struct srvinfo *results;
unsigned short count, i;
int status, len;
@@ -250,9 +250,10 @@ getsrvinfo(const char *srvname, const char *domainname,
struct srvinfo **si)
status = ESI_NODATA;
goto out;
}
+ eom = msg + len;
comp_dn = &msg[HFIXEDSZ];
- comp_dn += dn_skipname(comp_dn, msg + len) + QFIXEDSZ;
+ comp_dn += dn_skipname(comp_dn, eom) + QFIXEDSZ;
results = NULL;
for (i = 0; i < count; i++) {
@@ -260,7 +261,7 @@ getsrvinfo(const char *srvname, const char *domainname,
struct srvinfo **si)
struct srv *record;
int l;
- l = dn_expand(msg, msg + len, comp_dn, exp_dn, NS_MAXDNAME);
+ l = dn_expand(msg, eom, comp_dn, exp_dn, NS_MAXDNAME);
if (l == -1) {
status = ESI_PARSE;
goto out_free;
@@ -270,7 +271,7 @@ getsrvinfo(const char *srvname, const char *domainname,
struct srvinfo **si)
record = (struct srv *)&comp_dn[10];
comp_dn += 16;
- l = dn_expand(msg, msg + len, comp_dn, exp_dn, NS_MAXDNAME);
+ l = dn_expand(msg, eom, comp_dn, exp_dn, NS_MAXDNAME);
if (l == -1) {
status = ESI_PARSE;
goto out_free;
_______________________________________________
fedfs-utils-devel mailing list
[email protected]
https://oss.oracle.com/mailman/listinfo/fedfs-utils-devel