#195 Error in verbose output

closed-fixed
nobody
None
5
2013-01-29
2011-11-24
No

tsk3/fs/iso9660.c:2329

if (tsk_verbose) {
tsk_fprintf(stderr, "iso9660_open img_info: %lu"
" ftype: %" PRIu8 " test: %" PRIu8 "\n", (uintptr_t) img_info,
ftype, test);
}

The %lu in this code should be %jd on Linux. Otherwise it prints an incorrect value on a 64-bit platform.

Discussion

  • Joachim Metz

    Joachim Metz - 2011-11-24

    tsk3/fs/ntfs_dent.c:456

    "ntfs_proc_idxentry: Entry Details of %s: Str Len: %"
    PRIu16 " Len to end after current: %" PRIu64
    " flags: %x\n", fs_name->name, tsk_getu16(fs->endian,
    a_idxe->strlen),
    (uint64_t) (endaddr_alloc - (uintptr_t) a_idxe -
    tsk_getu16(fs->endian, a_idxe->idxlen)),
    fs_name->flags);

    Please check the %" PRIu64 " value calculation it seems to turn negative on a 64-bit platform.

     
  • Joachim Metz

    Joachim Metz - 2011-11-24

    sk3/fs/ntfs_dent.c:1001

    rec_len =
    (uint32_t) (idxalloc_len - (uintptr_t) idxrec_p -
    (uintptr_t) idxalloc);

    if (tsk_verbose)
    tsk_fprintf(stderr,
    "ntfs_dir_open_meta: Processing final index record (len: %"
    PRIu32 ")\n", rec_len);

    calculation of rec_len seems to return a negative value

     
  • Brian Carrier

    Brian Carrier - 2013-01-29
    • status: open --> closed-fixed
     
  • Brian Carrier

    Brian Carrier - 2013-01-29

    [master 9d70763] Fixed some debug messages in iso9660 of memory pointers that coudl be too big for data type in printf -- issue 3441763
    1 file changed, 20 insertions(+), 22 deletions(-)

    A combination of removing some of the statements and changing them to PRIu64 with needed casts. That seemed to be the safest cross platform approach.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks