Bug 17316

Summary: CodeReview: gevents out of bounds index
Product: R Reporter: Steve Grubb <sgrubb>
Component: Low-levelAssignee: R-core <R-core>
Status: CLOSED FIXED    
Severity: enhancement CC: maechler
Priority: P5    
Version: R 3.3.*   
Hardware: Other   
OS: Linux   
Attachments: Patch to fix the issue

Description Steve Grubb 2017-07-23 12:08:15 UTC
In src/main/devices.c R_Devices is defined as:


and comments say that R_MaxDevices set to 64. This means R_Devices can be
accessed with values between 0 and 63. The check for devnum > R_MaxDevices
allows 64 to be used which is outside of the legal limits.

A patch addressing this issue will be attached.
Comment 1 Steve Grubb 2017-07-23 12:08:48 UTC
Created attachment 2280 [details]
Patch to fix the issue
Comment 2 Martin Maechler 2017-07-24 10:36:01 UTC
Thank you for the report and the patch!
I'm commiting the fix.