Plastic deformation in metals involves stress-and temperature-driven motion of dislocations, which are topological defects interacting through elastic fields. While singular and nonsingular linear elasticity theories accurately describe long-range interactions between dislocations, both exhibit the ultraviolet catastrophe in the form of negative formation energies of short-wavelength fluctuations of dislocation lines, erroneously predicting straight dislocations to be unstable. We demonstrate how the positive energy of short-wavelength line fluctuations is restored by the nonlinearity and discreteness of the dislocation core. The treatment predicts positive formation energies of dislocation line fluctuations over their entire spectrum, in quantitative agreement with atomistic simulations, and by virtue of its simplicity lends itself to a convenient implementation in dislocation dynamics.