Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Deserializing strings stuck forever #17

Open
marcelotaube opened this issue Feb 18, 2018 · 1 comment
Open

Deserializing strings stuck forever #17

marcelotaube opened this issue Feb 18, 2018 · 1 comment

Comments

@marcelotaube
Copy link
Contributor

Currently ivy deserialize for string literals produces a loop which does not advance the loop index, effectively creating an infinite loop

Look at the code extracted:

        while (pos < inp.size() && inp[pos]) {
            if (inp[pos] == '"')
                throw deser_err();
         }
        res.push_back(inp[pos++]);
     }

Additionally i think it might be better to serialize the string size at the beggining of the package rather than checking for the first '\0' tab, that is because some users might want to treat the string as a generic buffer to store any binary piece of data.

@kenmcmil
Copy link
Contributor

kenmcmil commented Feb 18, 2018 via email

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

No branches or pull requests

2 participants