mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
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.
This commit is contained in:
parent
5d26d12f4a
commit
eb73b87897
@ -610,7 +610,9 @@ __res_context_querydomain (struct resolv_context *ctx,
|
||||
RES_SET_H_ERRNO(statp, NO_RECOVERY);
|
||||
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,
|
||||
anslen, answerp, answerp2, nanswerp2,
|
||||
|
Loading…
Reference in New Issue
Block a user