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

APPEND to object of block of odd length can crash #708

Open
rebolbot opened this issue Apr 11, 2009 · 2 comments
Open

APPEND to object of block of odd length can crash #708

rebolbot opened this issue Apr 11, 2009 · 2 comments

Comments

@rebolbot
Copy link
Collaborator

Submitted by: Sunanda

REBOL System Error 1305; invalid data type 83


append make object! [] reduce [a: 'x]

CC – Data [ Version: alpha 47 Type: Bug Platform: All Category: n/a Reproduce: Always Fixed-in:alpha 49 ]

@rebolbot
Copy link
Collaborator Author

rebolbot commented Apr 11, 2009

Submitted by: BrianH

This is what I get when I enter your code in a fresh console:

>> append make object! [] reduce [a: 'x]
*\* Script error: invalid argument: frame!
*\* Where: append
*\* Near: append make object! [] [x]

This is the wrong error – there is no frame! in that statement.

On a hunch I next try:

>> append make object! [] [x y z]

…and I get your crash error. This indicates that there is a bounds checking problem when you append a block with an odd number of values in it to an object.

APPEND to an object is supposed to add unset! when just a word! is appended, like this:

>> append make object! [] ’a == make object! [ a: unset! ]

Clearly when the value portion is missing from APPEND of [name value], it just tries to use whatever is next in memory instead of assigning unset!. Depending on what is next in memory, that could crash the system or render it corrupt.

Upped the severity and priority accordingly.

@Oldes
Copy link

Oldes commented Feb 9, 2020

This bug seems to be fixed, although there is different result when using block with word without value, or when used just a word:

>> append make object! [] [x]
== make object! [
    x: none
]

>> append make object! [] 'x
== make object! [
    x: unset!
]

I think that the result should be same... so having none! in the second case too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants