Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fromJSON Crash With Bad Input #24

Closed
brodieG opened this issue Jan 1, 2022 · 1 comment
Closed

fromJSON Crash With Bad Input #24

brodieG opened this issue Jan 1, 2022 · 1 comment

Comments

@brodieG
Copy link
Contributor

brodieG commented Jan 1, 2022

On current CRAN version. Obviously shouldn't be a common issue, but this suggests there might be some undefined behavior lurking in the code that might be worth protecting against.

> rjson::fromJSON('"\\U1F600"')
R(9747,0x10fa46e00) malloc: *** error for object 0x7fba26f74370: pointer being freed was not allocated
R(9747,0x10fa46e00) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6
rjson(issue20)$ 
R Under development (unstable) (2021-11-21 r81221)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur/Monterey 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.2.0 R6_2.5.0       magrittr_2.0.1 tools_4.2.0    roxygen2_7.1.1
 [6] Rcpp_1.0.7     xml2_1.3.2     stringi_1.6.2  knitr_1.33     xfun_0.23     
[11] stringr_1.4.0  rlang_0.4.11   purrr_0.3.4  
@alexcb
Copy link
Owner

alexcb commented Jan 5, 2022

great catch -- there was a double free occurring in this case. fixed in 1775e6e

@alexcb alexcb closed this as completed Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants