summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-11-30 13:10:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:53 -0500
commitfd18ab334a5b9aea301f8c5ba33b380b7ef76038 (patch)
tree51c01863b571ada1609c338d95d86c63773a61c7 /source4/librpc/ndr
parent7da0f7d76da1d779f324486df568fe884bcf6328 (diff)
downloadsamba-fd18ab334a5b9aea301f8c5ba33b380b7ef76038.tar.gz
samba-fd18ab334a5b9aea301f8c5ba33b380b7ef76038.tar.bz2
samba-fd18ab334a5b9aea301f8c5ba33b380b7ef76038.zip
r11973: make it easier to find bugs
metze (This used to be commit 247f90c28d845fd2224cb07ed30d3e8122ba5644)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/libndr.h3
-rw-r--r--source4/librpc/ndr/ndr_basic.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 7df3650e4a..ca66078614 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -166,7 +166,8 @@ enum ndr_err_code {
NDR_ERR_BUFSIZE,
NDR_ERR_ALLOC,
NDR_ERR_RANGE,
- NDR_ERR_TOKEN
+ NDR_ERR_TOKEN,
+ NDR_ERR_IPV4ADDRESS
};
enum ndr_compression_alg {
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index d76fa45ec3..f22e7989bf 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -570,7 +570,11 @@ NTSTATUS ndr_pull_ipv4address(struct ndr_pull *ndr, int ndr_flags, const char **
NTSTATUS ndr_push_ipv4address(struct ndr_push *ndr, int ndr_flags, const char *address)
{
uint32_t addr;
- if (!is_ipaddress(address)) return NT_STATUS_INVALID_PARAMETER_MIX;
+ if (!is_ipaddress(address)) {
+ return ndr_push_error(ndr, NDR_ERR_IPV4ADDRESS,
+ "Invalid IPv4 address: '%s'",
+ address);
+ }
addr = inet_addr(address);
NDR_CHECK(ndr_push_uint32(ndr, ndr_flags, htonl(addr)));
return NT_STATUS_OK;