From what I'm aware of, the cases to watch out for are companies that have an "all your base are belong to us" clause in their contract. Typically it is worded as "any invention, innovation or idea conceived solely by you or jointly with others at any time during your course of employment, and that relate to any current or future business activities of the employer". Of course I don't know how much such as broadly sweeping agreement can hold up in court, but apparently there are some companies (Google comes to mind) that have a department which will review their employee open source contributions and give them the green light (or not) to contribute.
For future employment, I always watch out for that clause. And then I ask questions such as "Does this include any volunteer work I do for charities, such as help them with their web site setup?"