BIND 8.2.2, trouble with dnssigner in contrib
Olafur Gudmundsson
ogud at tislabs.com
Wed Oct 20 14:27:00 UTC 1999
"Michael Milligan" writes:
>
> Hmm, couldn't build dnssigner. I did a little bit of digging, but (at this
> hour) couldn't grok the logic behind the GETWORDorEOLN macro used in
> parse/master_parse.c to figure out what to do. Probably obvious to the
> author.
>
> System info FWIW: Linux, SuSE 6.0 (glibc 2.0.7), kernel 2.2.12, gcc 2.7.2.3
>
> Regards,
> Mike
>
> --
Stupid me, I'm sure I did make clean before subitting prior patch and
tested it but here is a fix to the fix for Monster CERT and KEY records.
Olafur
apply in contrib/dns_signer/parse
Index: parse_rdata.c
===================================================================
RCS file: /proj/cvs/isc/bind/contrib/dns_signer/parse/parse_rdata.c,v
retrieving revision 1.4
diff -u -r1.4 parse_rdata.c
--- parse_rdata.c 1999/08/27 23:27:54 1.4
+++ parse_rdata.c 1999/10/18 15:40:54
@@ -193,7 +193,7 @@
{
int t_index = 0;
int nybble_number = 0;
- char first_nybble;
+ char first_nybble = 0x0;
char temptoken[MAXTOKENLENGTH];
if (token[0] == '0' && tolower(token[1]) == 'x') t_index = 2;
@@ -254,11 +254,26 @@
struct name_context *context, char **non_rr, int field_flag)
{
int ret_val;
- char token[MAXTOKENLENGTH];
- char temptoken[MAXTOKENLENGTH];
- char scratch_base64[65536];
+ char *token, *scratch_base64, *temptoken;
int binary_length;
+ if ((token = malloc(66000) == NULL) {
+ SET_PARSE_ERROR(errors, "Ran out of memory - B64 tokens","",*non_rr);
+ return (-1);
+ }
+
+ if ((temptoken = malloc(66000)) == NULL){
+ free(token);
+ SET_PARSE_ERROR(errors, "Ran out of memory - B64 tokens","",*non_rr);
+ return (-1);
+ }
+ if ((scratch_base64 = malloc(66000)) == NULL) {
+ free(token);
+ free(temptoken);
+ SET_PARSE_ERROR(errors, "Ran out of memory - B64 tokens","",*non_rr);
+ return (-1);
+ }
+
scratch_base64[0] = '\0';
do
@@ -275,6 +290,9 @@
{
SKIP_REST_OF_LINE(temptoken);
SET_PARSE_ERROR(errors, "Scratch overflow - B64 tokens","",*non_rr);
+ free(token);
+ free(temptoken);
+ free(scrach_base64);
return -1;
}
@@ -285,12 +303,17 @@
binary_length = b64_pton (scratch_base64, &rr->s_field[rr->s_index],
rr->s_length - rr->s_index);
+ free(token);
if (binary_length == -1)
{
SKIP_REST_OF_LINE(temptoken);
SET_PARSE_ERROR(errors, "Error decoding base64 string","",*non_rr);
- return -1;
+ free(scrach_base64);
+ free(temptoken);
+ return (-1);
}
+ free(scrach_base64);
+ free(temptoken);
if (binary_length == 0 && field_flag == FIELD_MANDATORY)
{
@@ -1927,7 +1950,7 @@
3 = PGP
253 = URL Private
254 = OID Private
- < 8 bit> - key tag
+ < 16 bit> - key tag
< 8 bit> - algorithm --> algorithm for key
<base64> - cert material
*/
More information about the bind-workers
mailing list