bugCERTI - Bugs: bug #47642, Usage of uninitialized RBLength...

 
 

bug #47642: Usage of uninitialized RBLength variables in SocketUN::receive() function

Submitted by:  JbCh <jb_ch>
Submitted on:  Thu 07 Apr 2016 12:03:39 PM UTC  
 
Category: CERTISeverity: 3 - Normal
Item Group: Software errorStatus: Invalid
Privacy: PublicAssigned to: JbCh <jb_ch>
Open/Closed: ClosedRelease: GIT-master
Reproducibility: NoneFixed Release: GIT-master

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 07 Apr 2016 01:00:29 PM UTC, comment #2:

Ok, thanks for the feedback.
My bad again, I overlooked the #ifndef #ifndef SOCKUN_BUFFER_LENGTH (and not #ifdef) at line 316.

I am closing this ticket as invalid,
many thanks :)

JbCh <jb_ch>
Project AdministratorIn charge of this item.
Thu 07 Apr 2016 12:44:19 PM UTC, comment #1:

Not really,

RBLength is always initialized but unfortunately this is done in differents places which is awkward.

2 cases:

1) SOCKUN_BUFFER_LENGTH is defined
Then the SockUN class has an
unsigned long RBLength; field defined which is initialized
in its constructor to 0.
lines 187--189 of SocketUN.hh
RBLength is updated in various places in SocketUN.cc receive.

2) SOCKUN_BUFFER_LENGTH is NOT defined
There is no class/object field defined but a local
variable RBLength is defined and initialized to 0
at lines 316--318 of SocketUN.cc.
In this case RBLength is always 0.

I think the current code is OK but
may it should be rewritten in a less awkward way.

Eric NOULARD <erk>
Project Administrator
Thu 07 Apr 2016 12:03:39 PM UTC, original submission:

Line 322 of SocketUN.cc, the receive function use RBLength in a while loop.

while (RBLength < Size)
{
..
}

However this variable seems to be only initialize when the SOCKUN_BUFFER_LENGTH compilation option is set.

I believe that, if I am correct, it should be initialize in any case (with and without the SOCKUN_BUFFER_LENGTH option set)

JbCh <jb_ch>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by erk (Posted a comment)
  • -unavailable- added by jb_ch (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 30 Aug 2017 10:23:49 AM UTCjb_chOpen/ClosedOpen=>Closed
    Thu 07 Apr 2016 01:00:29 PM UTCjb_chStatusNeed Info=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1