Karachi:Resuming at the overnight 127-5, Pakistan lost rookie Abdul Rehman (9) when paceman Andre Nel found the outside edge of the bat in the eighth over of the day.
That brought to the crease Butt, who had recovered from abdominal pains that prevented the left hander opening Pakistan's first innings on Tuesday and forced him to hospital for around 11 hours.
Butt showed no signs of weakness from illness and played some attractive drives off left-arm spinners Paul Harris and Makhaya Ntini.
Malik, nine overnight, completed his patient two-and-a-half-hour half century with a straight boundary off Harris and followed it with another four through the covers.
Malik is playing in his 19th test but leading Pakistan for the first time in a test match.
He also lofted Harris for a big six over long-on just before the break to complete 1000 test runs.
Nel (2-34) and Harris (2-56) were the main wicket-takers for South Africa.