Have you checked that the vector pointer 'pos' is non-NULL before calling this function?


Always learn from history, to be sure you make the same mistakes again...