Reputation: 23409
While reading Java Security I came across the below sentences but could not get any satisfactory explanation on the Internet. Can anyone please explain
Upvotes: 3
Views: 5053
Reputation: 29872
The byte code verifier makes the following checks:
Upvotes: 2
Reputation: 5931
We cannot, however, be sure that the class itself is safe. There is still the safety net of the SecurityManager which will prevent the class from accessing protected resources such as network and local hard disk, but that in itself is not enough. The class might contain illegal bytecode, forge pointers to protected memory, overflow or underflow the program stack, or in some other way corrupt the integrity of the JVM. Check Topic The Class File Verifier in [1]: http://medialab.di.unipi.it/doc/JNetSec/jns_ch5.htm
Upvotes: 3
Reputation: 8563
Source code is compiled to bytecode, which is distributed to users. If the bytecode has been damaged, or was not made by a java compiler, then it may be illegal, meaning that the bytes don't make sense.
Upvotes: 0