If the hull to deck joint is separating, you need some immediate assistance. I am not sure about this particular boat. But generally the C Dories are a semi shoe box hull to deck joint. The rub rail covers rivets on the outside. The way that most of the C Dories are made, is that the hull to deck joint is pop riveted thru the rub rail, then the inside is glassed over with at least a layer of cloth and resin. Some boats look like they may have been glassed then the railing put in place later, then the rivets smoothed on the inside and some filler (epoxy) on the inside.
See if you have loose pop rivets. The rubber inset in the railing is easily removed--and replaced if necessary. I would pull it, and check to see the condition of the rivets. If the rivets are pulling out (they may work thru the glass with time or they may have been right at the edge of the hull and pull up). Probably the best thing to do is to drill new rivet holes, put in new rivets and then put glass over the inside (I would grind down the old glass at the hull to deck joint, then reglass with epoxy and a layer of 12 oz biaxial cloth. If there is no substance to the hull at the upper part, then do the glass first, then pop rivet the railing. put small patches of glass and epoxy, then fair with filler over the pup rivets on the inside of the hull, and then paint over on the inside. If the rub rail material is still resiliant (my 1992 was still a year ago), push it back in place with broad blade screw drivers tapped in place, as you pull it aft. Either a screw or cap at the aft end will hold it in place. Silicone sealant may be necessary around the pop rivets--I would use the Boat Life, Life caulk there.