Merge branch 'js/ci-gcc-12-fixes'
Fixes real problems noticed by gcc 12 and works around false positives. * js/ci-gcc-12-fixes: dir.c: avoid "exceeds maximum object size" error with GCC v12.x nedmalloc: avoid new compile error compat/win32/syslog: fix use-after-reallocmaint
commit
db5b7c3e46
|
@ -323,7 +323,6 @@ static NOINLINE void RemoveCacheEntries(nedpool *p, threadcache *tc, unsigned in
|
||||||
}
|
}
|
||||||
static void DestroyCaches(nedpool *p) THROWSPEC
|
static void DestroyCaches(nedpool *p) THROWSPEC
|
||||||
{
|
{
|
||||||
if(p->caches)
|
|
||||||
{
|
{
|
||||||
threadcache *tc;
|
threadcache *tc;
|
||||||
int n;
|
int n;
|
||||||
|
|
|
@ -43,6 +43,7 @@ void syslog(int priority, const char *fmt, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
while ((pos = strstr(str, "%1")) != NULL) {
|
while ((pos = strstr(str, "%1")) != NULL) {
|
||||||
|
size_t offset = pos - str;
|
||||||
char *oldstr = str;
|
char *oldstr = str;
|
||||||
str = realloc(str, st_add(++str_len, 1));
|
str = realloc(str, st_add(++str_len, 1));
|
||||||
if (!str) {
|
if (!str) {
|
||||||
|
@ -50,6 +51,7 @@ void syslog(int priority, const char *fmt, ...)
|
||||||
warning_errno("realloc failed");
|
warning_errno("realloc failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
pos = str + offset;
|
||||||
memmove(pos + 2, pos + 1, strlen(pos));
|
memmove(pos + 2, pos + 1, strlen(pos));
|
||||||
pos[1] = ' ';
|
pos[1] = ' ';
|
||||||
}
|
}
|
||||||
|
|
9
dir.c
9
dir.c
|
@ -3137,6 +3137,15 @@ char *git_url_basename(const char *repo, int is_bundle, int is_bare)
|
||||||
end--;
|
end--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It should not be possible to overflow `ptrdiff_t` by passing in an
|
||||||
|
* insanely long URL, but GCC does not know that and will complain
|
||||||
|
* without this check.
|
||||||
|
*/
|
||||||
|
if (end - start < 0)
|
||||||
|
die(_("No directory name could be guessed.\n"
|
||||||
|
"Please specify a directory on the command line"));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Strip trailing port number if we've got only a
|
* Strip trailing port number if we've got only a
|
||||||
* hostname (that is, there is no dir separator but a
|
* hostname (that is, there is no dir separator but a
|
||||||
|
|
Loading…
Reference in New Issue