Skip to content

Commit

Permalink
Don't assert() that labels must be < 32 chars
Browse files Browse the repository at this point in the history
Labels can be up to 63 chars. If a longer label is encountered, we exit
cleanly instead of asserting (since it's an environment/invocation
issue, not an internal consistency issue).

Fixes VAS bug #23009.
  • Loading branch information
tedjp committed Feb 2, 2011
1 parent 4d25d3b commit 89089d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
1.3.5 [2011-02-03]
- Don't crash on labels longer than 32 characters (VAS bug #23009)

1.3.4 [2010-06-10]
- bug 763: Symbol not found: _vas_log_init, when using QAS 4.0
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# (c) 2006 Quest Software, Inc. All rights reserved.

AC_INIT([dnsupdate],
[1.3.4.]esyscmd(svnversion -n . /trunk || echo 0),
[1.3.5.]esyscmd(svnversion -n . /trunk || echo 0),
[[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([dnsupdate.c])
Expand Down
5 changes: 4 additions & 1 deletion dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ wr_label(struct dns_msg *msg, int len, const char *name)
{
unsigned char b;

assert(len < 32);
if (len > 63)
errx(1, "Refusing to write label \"%s\" "
"which is longer than 63 characters", name);

b = (unsigned char)len;
dns_wr_data_raw(msg, &b, sizeof b);
if (len)
Expand Down

0 comments on commit 89089d0

Please sign in to comment.