We're updating the issue view to help you get more done. 

Crash when convrtrs.txt is not available

Description

ICU crash when the convrtrs.txt file is not accessible (file not in ICU data
directory, ICU_DATA environment variable set to the wrong place, ...)
setupAliasTableAndAvailableConverters (ucnv_io.c) returns an error which is not
checked for in ucnv_getAvailableName (ucnv.c). Fix available as diff listing
(ucnv.c 1.4):
--------------------start diff
---------------------------------------------------- *** ucnv.c Tue Oct 19 09:29:42 1999
— ucnv.c.new Tue Oct 19 09:30:34 1999
***************

  •  

    •  

      • 286,292 ****
        /*lazy evaluates the list of Available converters */
        if (AVAILABLE_CONVERTERS_NAMES == NULL)
        setupAliasTableAndAvailableConverters (&err);
        ! if (index > AVAILABLE_CONVERTERS)
        return NULL;
        else
        return AVAILABLE_CONVERTERS_NAMES[index];

      • 286,292 ----
        /*lazy evaluates the list of Available converters */
        if (AVAILABLE_CONVERTERS_NAMES == NULL)
        setupAliasTableAndAvailableConverters (&err);
        ! if (U_FAILURE(err) || index > AVAILABLE_CONVERTERS)
        return NULL;
        else
        return AVAILABLE_CONVERTERS_NAMES[index];

        •  

          •  

            •  

              •  

                •  

                  •  

                    •  

                      •  

                        •  

                          •  

                            •  

                              •  

                                •  

                                  •  

                                    •  

                                      •  

                                        •  

                                          •  

                                            •  

                                              • end diff
                                                ---------------------------------------------------

Also the cintltst/ccapitst test does not check when as a result of above
situation
ucnv_countAvailable returns zero. Fix available as diff listing (ccapitst.c
1.3):
--------------------start diff
----------------------------------------------------- *** ccapitst.c Tue Oct 19 09:26:00 1999
— ccapitst.c.new Tue Oct 19 09:31:48 1999
***************

  •  

    •  

      • 208,213 ****

      • 208,218 ----
        log_verbose("Testing ucnv_countAvailable()...");


testLong1=ucnv_countAvailable();
+ if (!testLong1)
+ {
+ log_err("No Codepages vailable...\n");
+ exit(0);
+ }
log_verbose("Number of available Codepages: %d\n", testLong1);

log_verbose("\n---Testing ucnv_getAvailableName.."); /*need to check this
out */
----------------------- end diff
---------------------------------------------------
Bob.

Environment

Status

Assignee

TracBot

Reporter

TracBot

Labels

tracCreated

Oct 19, 1999, 10:14 AM

tracReporter

Bob_Verbrugge@54d93bdf15075132

tracResolution

fixed

tracStatus

closed

Components

Priority

assess