Karunaratne, batting on 18, also escaped being run out after getting into trouble with Madushka while taking a single off Hasan Mahmood.
Sri Lanka leads the two-match series 1-0 after winning the opening Test by 328 runs.
Experienced all-rounder Shakib Al Hasan returned for Bangladesh after a long Test absence and the hosts also gave Hasan Mahmood a debut.
Sri Lanka made the only change to the squad from the opening Test with Asitha Fernando replacing the injured Kasun Rajitha.