Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752657357, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"9fcf73b6102a4ce40c5ffa4f59f3f162", "commit": {"type":"commit", "time": 1503607337, "time_ofs": 600, "oid_tree": { "oid": "debe6087b1bc4e34e59073e0430216c72d16be58", "alias": []}, "oid":{ "oid": "678c462e213c3bf479bc93e4df5899ecfd914f91", "alias": []}, "msg": "Check for EOF in ASCII conversions.", "sig_commit": { "git_time": { "time": 1503607337, "offset": 600 }, "name": "Pauli", "email": "paul.dale@oracle.com", "md5": "4616f8cb80bd6ce4dab75d05e07cd125" }, "sig_author": { "git_time": { "time": 1503535591, "offset": 600 }, "name": "Pauli", "email": "paul.dale@oracle.com", "md5": "4616f8cb80bd6ce4dab75d05e07cd125" }}, "body": "Check for EOF in ASCII conversions.\n\nThe C standard defines EOF as:\n\n ... an integer constant expression, with type int and a negative value...\n\nThis means a conforming implemenetation could define this as a one of the\nprintable characters. This won't be a problem for ASCII.\n\nA specific test case has been added for EOF.\n\nReviewed-by: Richard Levitte \u003clevitte@openssl.org\u003e\n(Merged from https://github.com/openssl/openssl/pull/4240)\n" , "diff": "diff --git a/crypto/ctype.c b/crypto/ctype.c\nindex 588c6da..813be25 100644\n--- a/crypto/ctype.c\n+++ b/crypto/ctype.c\n@@ -8,6 +8,7 @@\n */\n \n #include \u003cstring.h\u003e\n+#include \u003cstdio.h\u003e\n #include \u0022internal/ctype.h\u0022\n #include \u0022openssl/ebcdic.h\u0022\n \n@@ -225,7 +226,7 @@ static const unsigned short ctype_char_map[128] \u003d {\n #ifdef CHARSET_EBCDIC\n int ossl_toascii(int c)\n {\n- if (c \u003c -128 || c \u003e 256)\n+ if (c \u003c -128 || c \u003e 256 || c \u003d\u003d EOF)\n return c;\n /*\n * Adjust negatively signed characters.\n@@ -240,7 +241,7 @@ int ossl_toascii(int c)\n \n int ossl_fromascii(int c)\n {\n- if (c \u003c -128 || c \u003e 256)\n+ if (c \u003c -128 || c \u003e 256 || c \u003d\u003d EOF)\n return c;\n if (c \u003c 0)\n c +\u003d 256;\ndiff --git a/test/ctype_internal_test.c b/test/ctype_internal_test.c\nindex 6b66cfb..04ab14d 100644\n--- a/test/ctype_internal_test.c\n+++ b/test/ctype_internal_test.c\n@@ -68,10 +68,16 @@ static int test_ctype_tolower(int n)\n \u0026\u0026 TEST_int_eq(ossl_tolower(case_change[n].l), case_change[n].l);\n }\n \n+static int test_ctype_eof(void)\n+{\n+ return test_ctype_chars(EOF);\n+}\n+\n int setup_tests(void)\n {\n ADD_ALL_TESTS(test_ctype_chars, 128);\n ADD_ALL_TESTS(test_ctype_toupper, OSSL_NELEM(case_change));\n ADD_ALL_TESTS(test_ctype_tolower, OSSL_NELEM(case_change));\n+ ADD_TEST(test_ctype_eof);\n return 1;\n }\n","s":{"c":1752657357,"u": 41001}} ],"g": 41651,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}