Beginning writers, and other creatives, often start out with a romantic attitude to their creative work. This makes them easy prey for shysters and scam artists. I've written about writer's rip-offs before, here.
Even if you know about the most common scams however, your own attitude can lead to disaster. I've been led up the garden path many times, simply because I love to write, and each time, it's always because I forgot that: WRITING IS WORK, SO GET PAID FOR IT.
Although you may love to write too , remember that writing is a business. If you have a publishing contract with a billion-dollar conglomerate, that's obvious, but it's also a business if you're writing for a small company. Business people tend to think that all's fair in business, and if you suspect you're being ripped off, you always are.
Be wary. Get paid. Most important of all: get your client to sign an agreement before you start the work.