Curl is C
I have no problem with Curl being written in C (I&#x27;ll take battle-tested C over experimental Rust) but this point seemed odd to me:<p>&gt;C is not the primary reason for our past vulnerabilities<p>&gt;There. The simple fact is that most of our past vulnerabilities happened because of logical mistakes in the code. Logical mistakes that aren’t really language bound and they would not be fixed simply by changing language.<p>So I looked at <a href="https:&#x2F;&#x2F;curl.haxx.se&#x2F;docs&#x2F;security.html" rel="nofollow">https:&#x2F;&#x2F;curl.haxx.se&#x2F;docs&#x2F;security.html</a><p>#61 -&gt; uninitialized random : libcurl&#x27;s (new) internal function that returns a good 32bit random value was implemented poorly and overwrote the pointer instead of writing the value into the buffer the pointer pointed to.<p>#60 -&gt; printf floating point buffer overflow<p>#57 -&gt; cookie injection for other servers : The issue pertains to the function that loads cookies into memory, which reads the specified file into a fixed-size buffer in a line-by-line manner using the fgets() function. If an invocation of fgets() cannot read the whole line into the destination buffer due to it being too small, it truncates the output<p>This one is arguably not really a failure of C itself, but I&#x27;d argue that Rust encourages a more robust error handling through its Options and Results when C tends to abuse &quot;-1&quot; and NULL return types that need careful checking and can&#x27;t usually be enforced by the compiler.<p>#55 -&gt; OOB write via unchecked multiplication<p>Rust has checked multiplication enabled by default in debug builds, and regardless of that the OOB wouldn&#x27;t be possible.<p>#54 -&gt; Double free in curl_maprintf<p>#53 -&gt; Double free in krb5 code<p>#52 -&gt; glob parser write&#x2F;read out of bound<p>And I&#x27;ll stop here, so far 7 out of 11 vulnerabilities would probably have been avoided with a safer language. Looks like the <i>vast majority</i> of these issues wouldn&#x27;t have been possible in safe Rust.