mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-06 14:10:30 +08: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. (cherry picked from commit eb73b87897798de981dbbf019aa957045d768adb)
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);
|
||||
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…
x
Reference in New Issue
Block a user