mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-24 12:20:59 +01:00
BUG/MEDIUM: standard: itao_str/idx and quote_str/idx must be thread-local
This bug has an impact on the stats applet and easily leads to a crash of HAProxy. This is specific to threads, no backport is needed.
This commit is contained in:
parent
919b739862
commit
99bca65f53
@ -92,7 +92,7 @@ struct split_url {
|
|||||||
int host_len;
|
int host_len;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int itoa_idx; /* index of next itoa_str to use */
|
extern THREAD_LOCAL int itoa_idx; /* index of next itoa_str to use */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* copies at most <size-1> chars from <src> to <dst>. Last char is always
|
* copies at most <size-1> chars from <src> to <dst>. Last char is always
|
||||||
@ -107,7 +107,7 @@ extern int strlcpy2(char *dst, const char *src, int size);
|
|||||||
* This function simply returns a locally allocated string containing
|
* This function simply returns a locally allocated string containing
|
||||||
* the ascii representation for number 'n' in decimal.
|
* the ascii representation for number 'n' in decimal.
|
||||||
*/
|
*/
|
||||||
extern char itoa_str[][171];
|
extern THREAD_LOCAL char itoa_str[][171];
|
||||||
extern char *ultoa_r(unsigned long n, char *buffer, int size);
|
extern char *ultoa_r(unsigned long n, char *buffer, int size);
|
||||||
extern char *lltoa_r(long long int n, char *buffer, int size);
|
extern char *lltoa_r(long long int n, char *buffer, int size);
|
||||||
extern char *sltoa_r(long n, char *buffer, int size);
|
extern char *sltoa_r(long n, char *buffer, int size);
|
||||||
|
|||||||
@ -46,14 +46,14 @@
|
|||||||
* '<span class="rls"></span>' around digits at positions 3N+1 in order
|
* '<span class="rls"></span>' around digits at positions 3N+1 in order
|
||||||
* to add spacing at up to 6 positions : 18 446 744 073 709 551 615
|
* to add spacing at up to 6 positions : 18 446 744 073 709 551 615
|
||||||
*/
|
*/
|
||||||
char itoa_str[NB_ITOA_STR][171];
|
THREAD_LOCAL char itoa_str[NB_ITOA_STR][171];
|
||||||
int itoa_idx = 0; /* index of next itoa_str to use */
|
THREAD_LOCAL int itoa_idx = 0; /* index of next itoa_str to use */
|
||||||
|
|
||||||
/* sometimes we'll need to quote strings (eg: in stats), and we don't expect
|
/* sometimes we'll need to quote strings (eg: in stats), and we don't expect
|
||||||
* to quote strings larger than a max configuration line.
|
* to quote strings larger than a max configuration line.
|
||||||
*/
|
*/
|
||||||
char quoted_str[NB_QSTR][QSTR_SIZE + 1];
|
THREAD_LOCAL char quoted_str[NB_QSTR][QSTR_SIZE + 1];
|
||||||
int quoted_idx = 0;
|
THREAD_LOCAL int quoted_idx = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* unsigned long long ASCII representation
|
* unsigned long long ASCII representation
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user