However sometimes the question and the problem describe show that the OP does not know how to ask the right question based on the problem.
I would say that in those case it is OK to answer the question based on the problem described rather then on the question asked.
Or alternatively use Edit to improve the question asked. I tend to avoid doing that since some OP are sensitive to changing they question to that degree (that is not what I have asked ect..). To avoid that kind of conflicts I just give the answer based on the actual problem described even if it does not fit the question asked.
Mostly those problems are in the Title of the Question.