buggnubg - Bugs: bug #42840, Possible Overflow in eval.c

 
 

bug #42840: Possible Overflow in eval.c

Submitted by:  Egon Votrubec <egon>
Submitted on:  Fri 25 Jul 2014 04:18:25 AM UTC  
 
Originator Name: Item Group: Other bug
Category: EvaluationsRelease: 1.01-Release
Privacy: PublicOperating System: All
OS Type: AnyProcessor Type: Any
Severity: 3 - NormalOpen/Closed: Closed
Assigned to: NonePriority: 5 - Normal
Status: Invalid

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 27 Jul 2014 02:30:46 AM UTC, comment #2:

You're absolutely right.

No, I haven't found a case where

I followed the path of the variable through EvaluatePositionCubeful4 and then through GetECF, but I hadn't taken into consideration the variable "cci", which in this case, being 1, bounds it as you say.

I spotted what I thought was a possible problem while converting the eval.c functions to a C# eval class. And as you may or may not know, C# is less flexible when it comes to working with arrays and this type of call isn't permitted.

Thanks for the clarification.

Egon Votrubec <egon>
Fri 25 Jul 2014 10:20:00 AM UTC, comment #1:

Technically a single float is an array of 1 floats.

The actual call:
if (EvaluatePositionCubeful3(nnStates, anBoard, arOutput, &rCubeful, pci, 1, pci, pec, nPlies, FALSE))
return -1;

bounds the array to a length of 1 via the 6th parameter (cci). In reviewing the code the cci parameter seems to be honored. Have you found a scenario where it isn't?

It might be more readable had the variable been assigned as:

float arCubeful[1];

instead of:

float rCubeful;

They do the same thing though.

Michael Petch <mdpetch>
Project Administrator
Fri 25 Jul 2014 04:18:25 AM UTC, original submission:

line 5864

GeneralEvaluationEPliedCubeful(...)

Assigns a float rCuebful and passes it to EvaluatePositionCubeful3() where it is used as an array.

Egon Votrubec <egon>

 

(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 mdpetch (Posted a comment)
  • -unavailable- added by egon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    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
    Sun 27 Jul 2014 12:28:10 PM UTCmdpetchOpen/ClosedOpen=>Closed
      StatusNone=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1