rseacord

Joined 6 years ago

Karma
560
Submissions
55
Member since
Mar 29
Robert Seacord is a Technical Director at NCC Group where he researches and teaches secure coding in C, C++, Java, and other languages. Seacord founded the secure coding initiative in the CERT Division of Carnegie Mellon University's Software Engineering Institute (SEI) and was an adjunct professor in the School of Computer Science and the Information Networking Institute at Carnegie Mellon University and at the University of Pittsburgh. He is an expert on ISO/IEC JTC1/SC22/WG14, the international standardization working group for the programming language C. He is also the author of six previous books, including The CERT C Coding Standard, Second Edition (2014), Secure Coding in C and C++, Second Edition (2013), The CERT Oracle Secure Coding Standard for Java (2011), and Java Coding Guidelines: 75 Recommendations for Reliable and Secure Programs (2014). Robert Seacord is on the Advisory Board for the Linux Foundation.
View on Hacker News

Recent submissions

Comment · 5 years ago
Comment · 5 years ago
Please submit a proposal.
Comment · 5 years ago
I've heard this comment more than once. What we are trying to accomplish is to collocate the resource acquisition code with the acquisition release code. This does mean that the release code is removed when where the release occurs (for example, at every location a function returns.

However, this is not without precedence in C. For example, just look at the for loop:

for (clause1; expression2; expression3) statement

expression3 is executed after statement.

Comment · 5 years ago
Yes, you are correct and there wasn't much support for capturing values so we would probably only support capture by reference and wait to see if C solves this problem in general by introducing lambdas.
Comment · 5 years ago
Based on feedback from the committee, I think it's very unlikely a dynamic approach will be used. The static only affects the for loop in terms of whether the deferred statements are run once or for each iteration of the loop, and the only real world use of this I've found so far involves allocating and deallocating resources within each loop iteration which would be supported by the static approach.
Comment · 5 years ago
Comment · 6 years ago
Comment · 6 years ago
Should work provided your wchar_t type is at least 21-bits wide.
Comment · 6 years ago
I don't really see C going anywhere. It's not going away, and it's not going to evolve into Java. It's going to remain especially useful for memory constrained and performance critical applications such as IoT and embedded.
Comment · 6 years ago
For (3) mandatory warnings the closest thing is probably ISO/IEC TS 17961:2013. The purpose of ISO/IEC TS 17961 is to establish a baseline set of requirements for analyzers, including static analysis tools and C language compilers, to be applied by vendors that wish to diagnose insecure code beyond the requirements of the language standard. All rules are meant to be enforceable by static analysis. The criterion for selecting these rules is that analyzers that implement these rules must be able to effectively discover secure coding errors without generating excessive false positives.
Comment · 6 years ago
Many of your remaining questions have devolved into "When will I see my favorite feature xyz appear in the C Standard?" The answer in most cases is "that depends on how long it takes you to submit a proposal". Take a look at http://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log... for previous proposals and review the minutes to see which proposals have been adopted. In general, the committee is not going to adopt proposals for which there is insufficient existing practice or haven't been fully thought out. There are cases where people have come to a single meeting with a well-considered proposal that was adopted into the C Standard. I wrote about one such case here: https://www.linkedin.com/pulse/alignment-requirements-memory... Alternatively, you can approach someone on the committee and ask us to champion a proposal for you. It is likely that we'll agree or at least provide you with feedback on your proposal.
Comment · 6 years ago
Comment · 6 years ago
Going to try to answer these separately. For (1) if you mean strings that are primitive types my guess is never. When had an hour discussion on this topic at a London meeting where we were discussing new features for C11 and my take away was that this would never happen because it would require a significant change to the memory model for the language.
Comment · 6 years ago
So I spend a possibly unreasonable amount of time and page space discussing VLAs in the Effective C book. I understand there are some problems with them, but for what it is worth, I really like the feature, particularly when used in function prototype scope.
Comment · 6 years ago
Microsoft originally implemented the Annex K Bounds checked interfaces (e.g., the *_s functions) back in the 1990s in response to well-publicized vulnerabilities. They proposed standardization to the C Standards committee. The committee made many changes to the proposal, possibly going too far away from the original implementation. During this time, I would say that Microsoft was very differential to the wishes of the committee.

By the time the ISO/IEC TR 24731-1:2007 was released, and then later Annex K added to the C Standard, Microsoft had to decide if they wanted to change the interfaces to conform to the changed standard and re-implement their code bases. They presumably decided that they did not, which I think is a defensible decision.

As to unergonomic, examples please?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton