Is there a security risk when using “break” in C #?

0 投票
最新提问 用户: (120 分)

When I was studying, I was advised not to use jump statements in my code, due to security reasons. But I'm talking about near-machine languages. Should I avoid "break" inside a loop, for example?

发表于 用户: (1.9k 分)
"due to security reasons" is incredibly vague - were you given any more details? If so, you can apply those details to break. If not, you should ask for a more concrete explanation.
发表于 用户: (180 分)
C# is considered a safe language. With safe one means that the runtime checks types, whether the program counter is still at valid code,... So that means you should be able to use all statements safely. Of course that does not mean that a hacker cannot exploit bugs in your code.
发表于 用户: (120 分)
@JonSkeet I mean if a break (for example) can be exploitable just for using it.
发表于 用户: (180 分)
"not to use jump statements in my code, due to security reasons." That's utter nonsense. Either you misunderstood what was said, or whoever said it is an imbecile.
发表于 用户: (1.9k 分)
Again, that's not really a concrete description of a vulnerability...

登录 或者 注册 后回答这个问题。

欢迎来到 Security Q&A ,有什么不懂的可以尽管在这里提问,你将会收到社区其他成员的回答。