strings = map + offset;
while (true) {
+ char *end = map + offset + size;
char *sep;
int len;
- while (!strings[0])
+ while ((strings < end) && !strings[0])
strings++;
- if (strings >= map + offset + size)
+ if (strings >= end)
break;
if (is_builtin) {
sep = strstr(strings, ".");
printf("name:\t\t%s\n", m->name);
printf("filename:\t%s\n", is_builtin ? "(builtin)" : mpath);
while (true) {
+ char *end = map + offset + size;
char *pname, *pdata;
char *dup = NULL;
char *sep, *sep2;
- while (!strings[0])
+ while ((strings < end) && !strings[0])
strings++;
- if (strings >= map + offset + size)
+ if (strings >= end)
break;
if (is_builtin) {
sep = strstr(strings, ".");