zlacker

[parent] [thread] 8 comments
1. lpapez+(OP)[view] [source] 2024-01-16 14:30:15
> Of course, this should never happen but can be difficult to guarantee when the limits are derived from user inputs.

Sounds to me like you are missing a validation step before calling your logic. When it comes to parsing, trusting user input is a recipe for disaster in the form of buffer overruns and potential exploits.

As they used to say in the Soviet Union: "trust, but verify".

replies(2): >>PaulDa+t2 >>iknows+R2
2. PaulDa+t2[view] [source] 2024-01-16 14:43:12
>>lpapez+(OP)
That was what Reagan said about the Soviet Union, not what was said in the Soviet Union.

Correct me if I'm wrong.

replies(3): >>useful+j6 >>plucas+O6 >>protom+A7
3. iknows+R2[view] [source] 2024-01-16 14:44:33
>>lpapez+(OP)
The answer is of course

    clamp(min(a,b), max(a,b))
classic c++
◧◩
4. useful+j6[view] [source] [discussion] 2024-01-16 15:02:31
>>PaulDa+t2
According to wikipedia you're right (about Reagan) but it's also a Russion proverb.
◧◩
5. plucas+O6[view] [source] [discussion] 2024-01-16 15:05:29
>>PaulDa+t2
https://en.wikipedia.org/wiki/Trust,_but_verify

> Trust, but verify (Russian: доверяй, но проверяй, tr. doveryay, no proveryay, IPA: [dəvʲɪˈrʲæj no prəvʲɪˈrʲæj]) is a Russian proverb, which is rhyming in Russian. The phrase became internationally known in English after Suzanne Massie, a scholar of Russian history, taught it to Ronald Reagan, then president of the United States, the latter of whom used it on several occasions in the context of nuclear disarmament discussions with the Soviet Union.

Memorably referenced in "Chernobyl": https://youtu.be/9Ebah_QdBnI?t=79

replies(3): >>PaulDa+ru >>fl0ki+Ad1 >>dekhn+pn1
◧◩
6. protom+A7[view] [source] [discussion] 2024-01-16 15:09:16
>>PaulDa+t2
Russian here. We use that expression from time to time: https://ya.ru/search/?text="доверяй%2C+но+проверяй"
◧◩◪
7. PaulDa+ru[view] [source] [discussion] 2024-01-16 16:52:24
>>plucas+O6
Thanks for the clarification/explanation!
◧◩◪
8. fl0ki+Ad1[view] [source] [discussion] 2024-01-16 20:00:41
>>plucas+O6
Also referenced in the Metro Exodus "Sam's Story" DLC because of the backstory of the two characters speaking, and nuclear weapons once again being part of the scenario.
◧◩◪
9. dekhn+pn1[view] [source] [discussion] 2024-01-16 20:46:07
>>plucas+O6
When I hear the phrase, I rewrite it to "don't trust, verify."
[go to top]