There is no conclusive evidence to show that varenicline is unsafe in people with heart disease. Based on patterns that the makers of the drug observed when they ran multiple studies, the FDA has suggested that there is a possible but unproven increased risk of heart attacks or other problems after taking varenicline. Later, larger, studies have not shown evidence of heart problems from varenicline, so this is still an area of uncertainty.
Because varenicline can only be prescribed by a doctor, you should discuss this when considering it as an option.
Medical review: Nathan Cobb, MD, September 26, 2017
US Food and Drug Administration. Safety review update of Chantix (varenicline) and risk of cardiovascular adverse events 12/12/2012. https://www.fda.gov/Drugs/DrugSafety/ucm330367.htm
Sterling LH, Windle SB, Filion KB, Touma L, and Eisenberg MJ. Varenicline and Adverse Cardiovascular Events: A Systematic Review and Meta-Analysis of Randomized Controlled Trials. J Am Heart Assoc. England; 2016;5(2).