His first field goal, a 30-yarder, reduced the San Jose State deficit to 7-3 in the first quarter. His second, a 22-yarder with 3:43 left in the second quarter, made it 17-6.
But in between, Gaffney had a 16-yard touchdown run and Jordan Williamson made a 40-yard field goal for Stanford.
The only one of Stanford's first six possessions that did not produce points came on the Cardinal's final drive of the first half, when Williamson missed a 52-yard field goal attempt with 16 seconds left.
NOTES: Stanford and San Jose State have met 67 times, but Saturday's game was probably the last between the Bay Area rivals for a while. The two will not meet next season. ... Both San Jose State and Stanford came into Saturday's game riding eight-game winning streaks, tied for the third-longest active streak among FBC teams. On Saturday, Ohio State extended its winning streak to 14 by beating San Diego State, but Arkansas State had its nine-game winning streak halted by Auburn. Stanford now stands alone with the second-longest active streak at nine in a row.