projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
93a5f6b
)
dn_expand regression test
author
Szabolcs Nagy
<nsz@port70.net>
Wed, 13 Aug 2014 07:35:38 +0000
(09:35 +0200)
committer
Szabolcs Nagy
<nsz@port70.net>
Wed, 13 Aug 2014 07:35:38 +0000
(09:35 +0200)
src/regression/dn_expand-empty.c
[new file with mode: 0644]
patch
|
blob
diff --git a/src/regression/dn_expand-empty.c
b/src/regression/dn_expand-empty.c
new file mode 100644
(file)
index 0000000..
62c52e3
--- /dev/null
+++ b/
src/regression/dn_expand-empty.c
@@ -0,0
+1,16
@@
+// dn_expand should accept empty name (single \0)
+#include <resolv.h>
+#include "test.h"
+
+int main(void)
+{
+ unsigned char packet[] = "";
+ char name[] = "x";
+ int r;
+ r = dn_expand(packet, packet+1, packet, name, 1);
+ if (r!=1)
+ t_error("__dn_expand(\"\") returned %d, wanted 1\n", r);
+ if (*name)
+ t_error("__dn_expand(\"\") failed: got \"%s\" wanted \"\"\n", name);
+ return t_status;
+}