mirror of git://sourceware.org/git/glibc.git
resolv: Avoid GCC 12 false positive warning [BZ #28439].
Replace a call to sprintf with an equivalent pair of stpcpy/strcpy calls
to avoid a GCC 12 -Wformat-overflow false positive due to recent optimizer
improvements.
(cherry picked from commit eb73b87897)
This commit is contained in:
parent
d36f457870
commit
92d5c52aaa
|
|
@ -610,7 +610,9 @@ __res_context_querydomain (struct resolv_context *ctx,
|
||||||
RES_SET_H_ERRNO(statp, NO_RECOVERY);
|
RES_SET_H_ERRNO(statp, NO_RECOVERY);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
sprintf(nbuf, "%s.%s", name, domain);
|
char *p = __stpcpy (nbuf, name);
|
||||||
|
*p++ = '.';
|
||||||
|
strcpy (p, domain);
|
||||||
}
|
}
|
||||||
return __res_context_query (ctx, longname, class, type, answer,
|
return __res_context_query (ctx, longname, class, type, answer,
|
||||||
anslen, answerp, answerp2, nanswerp2,
|
anslen, answerp, answerp2, nanswerp2,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue