I was given some specs and told what to anticipate from those calling functions in the lib I was writing. Turns out they are not so compotent and passed excessive data -knowingly-.
I should have taken more time and used what I know about secure coding (eg NEVAR use strcpy) because I've been trying to focus on that quite a lot lately (reading both the recent Oreilly texts) but it was a situation where the destination is ALWAYS suppose to be ample size. I thought my peer had half a brain. Sure I could use strncpy and I do now, but, for the sake of the thing (it was small) and he knew what was required of him and the bounds checking on his side.
I guess, you should -always- assume people are stupid. I don't know. I am the type of guy who thinks private members in classes aren't really necessary because the documentation should just outline areas not for the end coder and that it should be understood. If you really have to hide stuff and make it inaccessible purposely, what does that say about the anticipated user of it? Then again I'm not big into OOP.
Now I just spent a good half hour and found the source of a core dump. Hrm if I had nothing against thinkgeek I'd almost want this shirt.
I should have taken more time and used what I know about secure coding (eg NEVAR use strcpy) because I've been trying to focus on that quite a lot lately (reading both the recent Oreilly texts) but it was a situation where the destination is ALWAYS suppose to be ample size. I thought my peer had half a brain. Sure I could use strncpy and I do now, but, for the sake of the thing (it was small) and he knew what was required of him and the bounds checking on his side.
I guess, you should -always- assume people are stupid. I don't know. I am the type of guy who thinks private members in classes aren't really necessary because the documentation should just outline areas not for the end coder and that it should be understood. If you really have to hide stuff and make it inaccessible purposely, what does that say about the anticipated user of it? Then again I'm not big into OOP.
Now I just spent a good half hour and found the source of a core dump. Hrm if I had nothing against thinkgeek I'd almost want this shirt.
