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

Potential NullPointerException in REXPGenericVector and REXPList toDebugString() #33

Open
JoshStark opened this issue Oct 10, 2023 · 0 comments

Comments

@JoshStark
Copy link

The call to REXPGenericVector#toDebugString() or REXPList#toDebugString() may potentially throw a NullPointerException if the vector/list contains a null element. This can occur in some circumstances if an evaluation for source(...) is called on a script which contains function definitions.

For example, if i call .eval("source('myScript.R')") where myScript.R contains a simple function definition:

foo <- function(bar) {
    return(bar)
}

The REXP output will be an instance of REXPGenericVector containing an RList payload with two items: item0 is null, and item1 is a logical value.

For our use-case, it is quite common to source an ad-hoc library of functions to be used as part of an Rserve session, but when debugging, it falls over. Would it be possible to put in a null-check into toDebugString() in REXP classes which need to iterate over a list payload?

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

1 participant