diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2000-05-24 17:19:10 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2000-05-24 17:19:10 +0000 |
commit | 7e50ebb715054465143f1244295977dbfe778908 (patch) | |
tree | b2a33a1ea43d681d7f349cea8562192a2b64a87e /encoding | |
parent | 333317e652b2a0090b6ca444902d09a03acb5139 (diff) | |
download | libapr-util-7e50ebb715054465143f1244295977dbfe778908.tar.gz |
EBCDIC: Fail the setup of EBCDIC translation tables in sha1 and base64
code if the translation handle passed in is not for a single-byte
translation.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@57803 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'encoding')
-rw-r--r-- | encoding/ap_base64.c | 17 | ||||
-rw-r--r-- | encoding/apr_base64.c | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/encoding/ap_base64.c b/encoding/ap_base64.c index 63394669..b68f5cd9 100644 --- a/encoding/ap_base64.c +++ b/encoding/ap_base64.c @@ -120,7 +120,24 @@ API_EXPORT(ap_status_t) ap_base64init_ebcdic(ap_xlate_t *to_ascii, int i; ap_size_t inbytes_left, outbytes_left; ap_status_t rv; + int onoff; + /* Only single-byte conversion is supported. + */ + rv = ap_xlate_get_sb(to_ascii, &onoff); + if (rv) { + return rv; + } + if (!onoff) { /* If conversion is not single-byte-only */ + return APR_EINVAL; + } + rv = ap_xlate_get_sb(to_ebcdic, &onoff); + if (rv) { + return rv; + } + if (!onoff) { /* If conversion is not single-byte-only */ + return APR_EINVAL; + } xlate_to_ebcdic = to_ebcdic; for (i = 0; i < sizeof(os_toascii); i++) { os_toascii[i] = i; diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c index 63394669..b68f5cd9 100644 --- a/encoding/apr_base64.c +++ b/encoding/apr_base64.c @@ -120,7 +120,24 @@ API_EXPORT(ap_status_t) ap_base64init_ebcdic(ap_xlate_t *to_ascii, int i; ap_size_t inbytes_left, outbytes_left; ap_status_t rv; + int onoff; + /* Only single-byte conversion is supported. + */ + rv = ap_xlate_get_sb(to_ascii, &onoff); + if (rv) { + return rv; + } + if (!onoff) { /* If conversion is not single-byte-only */ + return APR_EINVAL; + } + rv = ap_xlate_get_sb(to_ebcdic, &onoff); + if (rv) { + return rv; + } + if (!onoff) { /* If conversion is not single-byte-only */ + return APR_EINVAL; + } xlate_to_ebcdic = to_ebcdic; for (i = 0; i < sizeof(os_toascii); i++) { os_toascii[i] = i; |