Content deleted Content added
m Remove incorrect code comments, compilers will not remove default sections even if all possible enum values are covered. Compilers are not allowed to do this due to enums having more bit patterns than they have named members. A compilable example can be found here https://godbolt.org/z/hnKv7h8as |
→Other ways of securing code: CRC not ggod for IDing accidental tamper |
||
Line 138:
===Other ways of securing code===
* One of the most common problems is unchecked use of constant-size or pre-allocated structures for dynamic-size data{{cn|date=December 2023}} such as inputs to the program (the [[buffer overflow]] problem). This is especially common for [[string (computer programming)|string]] data in [[C (programming language)|C]]{{cn|date=December 2023}}. C library functions like <code>gets</code> should never be used since the maximum size of the input buffer is not passed as an argument. C library functions like <code>scanf</code> can be used safely, but require the programmer to take care with the selection of safe format strings, by sanitizing it before using it.
* Encrypt/authenticate all important data transmitted over networks. Do not attempt to implement your own encryption scheme, use a [[Cryptography standards|proven one]] instead. Message checking with
====The three rules of data security====
|