diff options
Diffstat (limited to 'src/xrdb.c')
| -rw-r--r-- | src/xrdb.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/xrdb.c b/src/xrdb.c index ce6e7d21edb..10bc76986e6 100644 --- a/src/xrdb.c +++ b/src/xrdb.c | |||
| @@ -177,12 +177,8 @@ magic_db (const char *string, ptrdiff_t string_len, const char *class, | |||
| 177 | 177 | ||
| 178 | /* Do we have room for this component followed by a '\0'? */ | 178 | /* Do we have room for this component followed by a '\0'? */ |
| 179 | if (path_size - path_len <= next_len) | 179 | if (path_size - path_len <= next_len) |
| 180 | { | 180 | path = xpalloc (path, &path_size, path_len - path_size + next_len + 1, |
| 181 | if (min (PTRDIFF_MAX, SIZE_MAX) / 2 - 1 - path_len < next_len) | 181 | -1, sizeof *path); |
| 182 | memory_full (SIZE_MAX); | ||
| 183 | path_size = (path_len + next_len + 1) * 2; | ||
| 184 | path = xrealloc (path, path_size); | ||
| 185 | } | ||
| 186 | 182 | ||
| 187 | memcpy (path + path_len, next, next_len); | 183 | memcpy (path + path_len, next, next_len); |
| 188 | path_len += next_len; | 184 | path_len += next_len; |