To be additionally pedantic as a physicist, dW = 0 means we have extramized the action. Technically, we are looking for a path of stable action (i.e. a small change to the path does not change the action), so both maxima, minima, and even saddle curves are allowed solutions.