Hold the length of baseboard against the wall at floor level.
Hold a pencil flat to the wall, positioned perpendicular to the baseboard with its point against the top of the baseboard.
Drag the pencil along the top of the baseboard. The irregularities in the warped wall will cause the pencil to skip, making the line drawn on the baseboard waver.
Use the line, as a guide, to trim down the edge of the baseboard with a jigsaw. In many case, the cut that you need to make is very shallow but cut carefully to make sure that it will accommodate the baseboard to the wall. Though this project is straightforward, a wavering cut means that you will still see some gaps due to the warped wall.