4 ms·
> It is clear that the original intent of calloc is to allocate heap memory for arrays of objects in a safe way This again? Just 4 days ago there was an articl
by bluefox 10y ago
> It is clear that the original intent of calloc is to allocate heap memory for arrays of objects in a safe way
This again? Just 4 days ago there was an article making up the same nonsense.
- qwertyuiop924 10y ago>This again? Just 4 days ago there was an article making up the same nonsense. Seems perfectly reasonable. Care to enlighten me?
- bluefox 10y agoPlease give historical evidence that the original intent behind calloc was to allocate heap memory for arrays of objects in a safe way.
- jsjohnst 10y agoThat was the tiniest of point in this article (unlike the last one). This article is far more useful and accurate to the average person.
- bluefox 10y agoI agree. It's interesting that two seemingly independent sources make the same unfounded claim about this obscure C function so close in time. Since I replied in the first case, I was sensitive to the second case. Perhaps someone should make a third attempt so that we can conclude that it's a conspiracy to rewrite the history of calloc.
- jsjohnst 10y agoI am pretty positive they aren't unrelated. Both mentioned Python's requests library and PyOpenSSL if memory serves. If I had to hazard a guess, it felt like the first one was potentially written by the reporter of the initial bug, the second by the actual developer who investigated it. This is just a guess, but I bet if you reread both you'll likely agree with me.
- qwertyuiop924 10y ago...The API seems to be pretty strong evidence to that effect. Do you have some evidence to counter? I'm genuinely curious here.
- jsjohnst 10y agoComments on the post earlier in the week traced the history through many historic implementations of calloc and found that there was no evidence to support that claim.
- qwertyuiop924 10y agoAh. Missed that post.
- bluefox 10y agoAt the time calloc was invented the class of "safety"-related integer overflow problems wasn't on the map at all. So a case of someone thinking about it at the time would be quite interesting. I specifically asked for "historical evidence" because I expected that the first thing on your (or someone else's) mind would be to make this inference from prototype to intent. This expectation was met, and unfortunately you disregarded this subtlelity and moved on to reply. You didn't go look for historical evidence (that does not exist), a path which could have led to the "enlightenment" you sought. Historical claims should be based on historical evidence, not made up. Just because an something is so, does not mean that it was intended to be so for reason X. As you'll find with experience, rationale cannot be deduced from code. Code is merely an indicator.
- qwertyuiop924 10y agoIndeed I disregarded this subtlety in my reply. Why? Because I asked you a question. I don't mind putting in work to answer questions, but I won't put in busy work. If there's someone in front of me that knows the answers, I'd rather ask that person than try to find those answers again. >a path which could have led to the "enlightenment" you sought. But I wasn't seeking "enlightenment," or anything of the sort. I was seeking a piece of knowledge that you posessed. You essentially told me to go find it myself. I'm not doing that, because my time is a finite resource, and the person I'm talking to already knows and could tell me.