Appease ubsan

ERR_LIB_USER has value 128, and shifting into the sign bit upsets the
shift sanitizer.

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Emilia Kasper 2016-05-11 22:41:29 +02:00
parent 6302bbd21a
commit d82c27589b

View File

@ -235,7 +235,7 @@ typedef struct err_state_st {
# define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
# define ERR_PACK(l,f,r) \
( (((l) & 0x0FF) << 24L) | (((f) & 0xFFF) << 12L) | ((r) & 0xFFF) )
( ((unsigned int)((l) & 0x0FF) << 24L) | (((f) & 0xFFF) << 12L) | ((r) & 0xFFF) )
# define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL)
# define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL)
# define ERR_GET_REASON(l) (int)((l)&0xfffL)