core: check that string is not NULL in function string_input_for_buffer