Skip to contentSkip to conversation

Bug in plugin/object/obj40/obj40_repair.c

DISCUSSION David T Hollis 2 participants 2 messages Aug 28, 2003

lore
Share & tools
lore
#0 lore raw

I was having trouble compiling reiser4progs due to warnings being treated as errors and came across this function that GCC reported 'info possibly being used uninitialized'. In looking at it, it does look bad. Info is never assigned to anything before it is being accessed. I don't know what it is supposed to point to so I can't provide a patch at this time, but I thought I'd bring it up.

/* Checks that @obj->info.start is SD of the wanted file. */

errno_t obj40_stat(obj40_t *obj, stat_func_t stat_func) {
       object_info_t *info;
       errno_t res;
                                                                              

       aal_assert("vpf-1200", obj != NULL);
                                                                              

       if (!info->start.plug) {
^^^^^^^^^^^^^^^^^^^^^
               if (!obj->core->tree_ops.valid(info->tree, &info->start))
                       return RE_FATAL;
#1 lore raw

Hi David,

Quoted 9 lines · David T Hollis

I was having trouble compiling reiser4progs due to warnings being treated as errors and came across this function that GCC reported 'info possibly being used uninitialized'. In looking at it, it does look bad. Info is never assigned to anything before it is being accessed. I don't know what it is supposed to point to so I can't provide a patch at this time, but I thought I'd bring it up.

/* Checks that @obj->info.start is SD of the wanted file. */

Quoted 12 lines
errno_t obj40_stat(obj40_t *obj, stat_func_t stat_func) {
        object_info_t *info;
        errno_t res;


        aal_assert("vpf-1200", obj != NULL);


        if (!info->start.plug) {
^^^^^^^^^^^^^^^^^^^^^
                if (!obj->core->tree_ops.valid(info->tree, &info->start))
                        return RE_FATAL;

thank you for the report, I am fixing it now.

Signature · 2 lines
Thanks,
Vitaly Fertman