4 ms·
Whilst true, there’s a swathe of modern tooling that will aide in marshalling data for IPC. Would you not agree that if protobuf, json or yaml were used, it’d b
by eptcyka 1y ago
Whilst true, there’s a swathe of modern tooling that will aide in marshalling data for IPC. Would you not agree that if protobuf, json or yaml were used, it’d be far less likely for this bug have slipped in?
- alexvitkov 1y agoIn isolation, for any one particular bug, yes, but if you start applying this logic to everything, even problems as simple as reading some bytes from a file, you end up with a heao of dependencies for the most mundane things. We've tried that, it's bad.
- gpm 1y agoOn the contrary, we've tried it and it works great.
- sunshowers 1y agoNo, I think in general you should trust other people with experience in an area more than your own naive self. Division of labor and all that. There are exceptions, as always, but using dependencies is good as a first approximation.
- eptcyka 1y agoI don't believe we must apply any guideline ad absurdum. Using a battle tested marshalling/serialization library is clearly the way to go most often. Of course, one can still construct difficult to parse XML and JSON or any other blob for any given format, but the chances that bad input will result in an RCE are lower.
- bangaladore 1y agoThe OC was about language choice. You can use protobuf, json or yaml in C as well. In general, though, all these can be wildly overkill for many tasks. At some point you just need to write good code and actually test it.
- greatgib 1y agoHaving "safe" yaml parsing is a whole topic of head scratching in whatever language of your choice if you want a rabbit hole to look into...
- bpt3 1y agoNo I would not agree that YAML or JSON parsers in any language are far less likely to have logic errors, and I'm not sure why protobuf (a binary format) would be a good choice for a human readable file. INI is not a particularly complex format (less complex than YAML for example), and there are existing open source parsers written in C that could have been used. You can dig in all you want, but this is not an issue with C strings or the INI format.
- account42 1y agoThis isn't even a parser error at all - the INI format comes from DOS/Windows where a trailing carriage return would not be considered part of the value either.