Skip to content

Commit 876a814

Browse files
author
Omar Sharieff
committed
Bug#31933415 : OUT OF BOUND READ IN ER().
Backport. Fixed the case of unknown error. RB#27748
1 parent 1829cc1 commit 876a814

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/errmsg.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef ERRMSG_INCLUDED
22
#define ERRMSG_INCLUDED
33

4-
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License, version 2.0,
@@ -40,7 +40,8 @@ extern const char *client_errors[]; /* Error messages */
4040
#define CR_MAX_ERROR 2999
4141
#if !defined(ER)
4242
#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \
43-
client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR])
43+
client_errors[(X) - CR_ERROR_FIRST]: \
44+
client_errors[CR_UNKNOWN_ERROR - CR_ERROR_FIRST])
4445

4546
#endif
4647
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */

0 commit comments

Comments
 (0)