CID 348325: Using uninitialized value in bin/dig/host.c
*** CID 348325: (UNINIT)
/bin/dig/host.c: 319 in printsection()
313 }
314 if (!short_form) {
315 isc_buffer_usedregion(&target, &r);
316 if (no_rdata) {
317 printf(";%.*s", (int)r.length, (char *)r.base);
318 } else {
>>> CID 348325: (UNINIT)
>>> Using uninitialized value "*r.base" as argument to "%.*s" when calling "printf". [Note: The source code implementation of the function has been overridden by a builtin model.]
319 printf("%.*s", (int)r.length, (char *)r.base);
320 }
321 }
322
323 result = dns_message_nextname(msg, sectionid);
324 if (result == ISC_R_NOMORE) {
/bin/dig/host.c: 317 in printsection()
311 }
312 }
313 }
314 if (!short_form) {
315 isc_buffer_usedregion(&target, &r);
316 if (no_rdata) {
>>> CID 348325: (UNINIT)
>>> Using uninitialized value "*r.base" as argument to "%.*s" when calling "printf". [Note: The source code implementation of the function has been overridden by a builtin model.]
317 printf(";%.*s", (int)r.length, (char *)r.base);
318 } else {
319 printf("%.*s", (int)r.length, (char *)r.base);
320 }
321 }
322
The contents at *r.base
can be uninitialized when calling printf(";%.*s", (int)r.length, (char *)r.base);
, but since the string format has a precision field (r.length
), which is initialized to 0
in any case, it should prevent the printf()
code from using the uninitialized data (checked in Linux with glibc), so I think this is not a serious issue, but nonetheless, should be fixed.