Westwood has a lot of homeless people, but they are harmless in general. UCLA is safe in general, at least compared to USC, so there is no need to carry a gun (no, it is uncommon here in California).
We do receive reports of the occasional robbery or sexual assault. But as long as you are careful and alert when you walk alone especially at night, you should be fairly safe. The University has an Evening Van Service that provides free trips to areas near campus via (310) 825-1493. The van only stops at certain locations but if you are in the dorms that should not be an issue as the pathways are lighted up pretty decently. If you have to walk alone at night, you can opt for an escort via Walking Escorts by calling (310) 794-9255 (794-WALK) whereby a Community Service Officer will accompany you to your destination. You do have to wait for 10 minutes or more though if you opt for these services.
Located near the San Andreas fault, LA is a seismically active area and we are overdue for a magnitude 7 earthquake. For those who are curious as to the frequency of earthquakes, feel free to check out this site. You would probably notice that a large number of the quakes are magnitude 3 or less which would not usually be felt. However, it would be good to take note of some safety measures on what to do in the event of an earthquake. Some professors (though this is rarely the case) would actually go through the simple drill of drop and take cover on the first day of classes. Most buildings are adequately reinforced to withstand large earthquakes according to local building codes so the general advice is not to run out but to hide underneath a structure in the event of an earthquake and only leave shortly after the shaking has stopped.

