Hi! There is no check for (buffer.length() >= strlen(suffix)) before the strcmp() condition: if (!strcmp(&buffer.c_str()[buffer.length()-strlen(suffix)], suffix)) { which might lead to undefined behaviour. Best regards, Jaak