Bug 16330 - foreign package: memory protection error (trivial to fix)
Summary: foreign package: memory protection error (trivial to fix)
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Add-ons (show other bugs)
Version: R-devel (trunk)
Hardware: All All
: P5 normal
Assignee: R-core
Depends on:
Reported: 2015-04-23 10:53 UTC by Tomas Kalibera
Modified: 2015-04-23 10:53 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Kalibera 2015-04-23 10:53:41 UTC
In src/spss.c in read_SPSS_SAVE around line 573

setAttrib(ans, install("codepage"), ScalarInteger(inf.encoding));

The scalar integer box for inf.encoding is unprotected - it may be killed by install if install gets called after ScalarInteger.

Possible fix - create the symbol fist, e.g. s_codepage = install("codepage") and then call setAttrib(ans, s_codepage, ScalarInteger(inf.encoding));