The game appeared to be heading for a draw until Huddersfield were awarded a free-kick 30-yards from goal with seven minutes remaining.
Gudjonsson's initial free-kick was handled by Jose Semedo, prompting the referee to move it forward 10-yards and this time the Iceland international drilled a stunning shot past the wall and into the back of Sullivan's net.
Only a crucial last-gasp tackle by Jamie McCombe prevented Scott Wagstaff from firing the Addicks in front inside the opening minute.
Paul Benson shot straight at visiting keeper Ian Bennett, while the Terriers stopper also had to be alert to catch Gary Doherty's 27th minute header.
Michael Stewart twice went close for Charlton early in the second half, while Gary Roberts headed just wide at the other end.