If isn't dangerous... If you need a light snack before bed there is nothing wrong with that; you will never be able to sleep on an empty stomach, BUT, eating right before bed isn't the best idea because the energy that should be used to revitalize your body overnight will then be used to digest the food making it so that you are not as energetic the next day.
At night your metabolism slows down along with your digestive process. As long as you stick to fruits and vegetables you are fine. Heavy fried foods and junk food will not digest properly and will still be in your stomach in the morning.
Unless you're a gremlin, you'll be fine. It might slow down your metabolism and make you gain some weight though. You shouldn't eat unless you're going to stay up for at least an hour. That's what I've been told anyway.