DEV Community

Welcome at work Kyle!

Paula on September 02, 2019

Hello there! I've been working in several projects this summer, but in between I practised a bit about exploiting in Linux as a part of cybersecuri...
Collapse
 
biscotte021 profile image
Biscotte021

Thank you very much for your sharing, do you know how can it be fixed?

Collapse
 
tanjent profile image
tanjent • Edited

Specifically with C, buffer overruns such as Kyle's are a well-known error. In this case, the problem could be solved by calling strncpy() rather than strcpy(), which allows the program to limit to copying a maximum of 32 characters.

Also, teach Kyle to use lint and/or other code checking tools to find these sorts of mistakes.

An arguably better solution would be to teach Kyle to use a couple lines of shell script instead of writing C code for something this trivial. Of course, every language has its security problems, so this is really just changing problems rather than solving them.

Collapse
 
biscotte021 profile image
Biscotte021

@tanjent , thank you for your feedback, I agree with you each language has their security issues, the most important thing is how to solved them :)

Collapse
 
terceranexus6 profile image
Paula

thank you! I couldn't possibly answer better. Poor Kyle, though, you are being too hard on him hahaha

Collapse
 
awwsmm profile image
Andrew (he/him)

Great post, Paula! Thanks for writing it!

Collapse
 
terceranexus6 profile image
Paula

Thank you! I'm grad you enjoyed.