Contributed by jose on from the string-function-inquisition dept.
"The OpenBSD team is currently purging the source of as many instances of dangerous string functions (strcpy, strcat, sprintf, etc) where they can. They will be replacing them with the the bounds-checking family of these functions (strlcat, strlcpy, snprintf, and asprintf) "where applicable."The diffs between these files will be an excellent illustrative tool of how to migrate from functions that don't do bounds checking to ones that do. This is highly suggested reading for people that are interested in learning how to do this (because it's not always as simple as strcat() -> strlcat()).Theo has asked everyone to help test the new code out when 3.4-snapshots become available.
MARCs archive of the email is here: Theo's Message "
(Comments are closed)
By Anonymous Coward () on
Comments
By tony () tony@libpcap.net on http://libpcap.net
I was thinking pre 3.4 not post 3.3 which got me all clusterfscked. I meant 3.4 snapshots as in the releases before 3.4 for some reason. Ah well.
By Frollochy () on
Beta's are what come out and I believe they are essentially snapshots of -current that are created every so often after the code has been suspended for new features and they are bugtesting in preparation for the release.
Comments
By jolan () on
3.3-beta
3.3
3.3-current <-- we're here now
3.4-beta
3.4 <-- in ~6 months
3.4-current--> -->
By Anonymous Coward () on
str(cat|cpy) is dying. One more crippling bombshell hit the already beleaguered str* community when IDC confirmed that str market share has dropped yet again, now down to less than a fraction of 1 percent of all function calls...you get the idea :)
Comments
By Anonymous Coward () on
By Anonymous Coward () on
By Anonymous Coward () on
Comments
By Miod Vallat () miod@openbsd.org on mailto:miod@openbsd.org
(sorry... could not resist)
Comments
By Anonymous Coward () on
By Anonymous Coward () on
Comments
By mirabile () mirabile@bsdcow.net on http://MirBSD.BSDadvocacy.org/
Comments
By Anonymous Coward () on
Comments
By Anonymous Coward () on
By Anonymous Coward () on
By Anonymous Coward () on
By awk fu () on
By Anonymous Coward () on
By Anonymous Coward () on
By Anonymous Coward () on
Comments
By tedu () on
By Marc Espie () espie@openbsd.org on mailto:espie@openbsd.org
However, this purge is done very carefully, and the code is replaced with clearer code. Those safe functions are just simpler to write code correctly for.
By Anonymous Coward () on
In addition to what Marc Espie said there's some gcc instrumentation being done that should catch most stupid errors using those functions.