Second-harmonic generation in a magnetic plasma waveguide is examined on the basis of the Hamiltonian technique. A characteristic length, within which a primary wave is totally transformed into its second harmonic, is estimated. The allowed deviations of plasma density from its mean value for the second-harmonic generation, are discussed.