Skip to content

Commit

Permalink
Fix possible access to undefined memory region.
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Mammedov <niallain@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Igor Mammedov authored and Steve French committed May 21, 2008
1 parent b9a3260 commit 5651ced
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/cifs/dns_resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
rkey = request_key(&key_type_dns_resolver, name, "");
if (!IS_ERR(rkey)) {
data = rkey->payload.data;
cFYI(1, ("%s: resolved: %s to %s", __func__,
rkey->description,
*ip_addr
));
} else {
cERROR(1, ("%s: unable to resolve: %s", __func__, name));
goto out;
Expand All @@ -150,6 +146,11 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
if (*ip_addr) {
memcpy(*ip_addr, data, len);
(*ip_addr)[len] = '\0';
if (!IS_ERR(rkey))
cFYI(1, ("%s: resolved: %s to %s", __func__,
name,
*ip_addr
));
rc = 0;
} else {
rc = -ENOMEM;
Expand Down

0 comments on commit 5651ced

Please sign in to comment.