Fix crash due to invalid C string handling in fetch request cache key computation