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

 
 

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

Submitter:  JbCh <jb_ch>
Submitted:  Thu 07 Apr 2016 12:03:39 PM UTC
   
 
Category:  CERTI Severity:  * 3 - Normal
Item Group:  Software error Status:  Invalid
Privacy:  Public Assigned to:  jb_ch
Open/Closed:  Closed Release:  * GIT-master
Reproducibility:  None Fixed Release:  * GIT-master
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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>
Group 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>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-30 jb_ch Open/ClosedOpen Closed
    2016-04-07 jb_ch StatusNeed Info Invalid

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code