Branch: Tag:

2021-02-13

2021-02-13 16:06:11 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Strings [PIKE_DEBUG]: Added some NUL-termination checks.

697: Inside #if defined(PIKE_DEBUG)
   struct pike_string * t = ba_alloc(&string_allocator);   #ifdef PIKE_DEBUG    gc_init_marker(t); +  if (generic_extract(str, shift, len)) { +  Pike_fatal("Static string \"%.*s\" is not NUL-terminated!\n", len, str); +  }   #endif    t->flags = STRING_NOT_HASHED|STRING_NOT_SHARED;    t->size_shift = shift;
716:    struct pike_string *s;    ptrdiff_t h = StrHash(str, len);    + #ifdef PIKE_DEBUG +  if (generic_extract(str, shift, len)) { +  Pike_fatal("Static string \"%.*s\" is not NUL-terminated!\n", len, str); +  } + #endif +     s = internal_findstring(str,len,shift,h);       if (!s) {