Re: Fix : an access to uninitialized data.

Ray Johnston <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Igor,

While I acknowleg]dge the code improvement with both these
changes, I do not see that they are related.

Please commit each with an individual LOG message.

Regards,
Ray
___________________________________________________________________________

Igor V. Melichev wrote:

> [Log message beg]
> Fix : an access to uninitialized data.
> 
> DETAILS :
> 
> 1. pcpath->path_list was not reset when it is replaced with a rectangle.
>    Bug 687178 "Infinite loop in ialloc_validate_memory".
> 
> 2. Type 11 fonts got an occasional indeterministic data to pdata->Encoding,
>    which were inaccurately checked for r_size() <= 256.
> 
> EXPECTED DIFFERENCES :
> 
> I did not detected any difference on Windows,
> but I believe that the old code was indeterministic.
> [Log message end]
> 
> 
> Changes: 
>  
>  
>  
> *** f:\casper\HEAD\gs\src\gxcpath.c Fri Nov 14 01:27:27 2003
> --- files\gs\src\gxcpath.c Thu Dec  4 02:49:04 2003
> ***************
> *** 586,589 ****
> --- 586,590 ----
>    /* Release the existing path. */
>    rc_decrement(pcpath->path_list, "gx_cpath_intersect");
> +  pcpath->path_list = NULL;
>    gx_path_new(&pcpath->path);
>    ppath->bbox = new_box;
>  
>  
>  
> *** f:\casper\HEAD\gs\src\zbfont.c Sat Nov  1 01:12:43 2003
> --- files\gs\src\zbfont.c Thu Dec  4 03:49:22 2003
> ***************
> *** 448,457 ****
>   {
>       const ref *pfe = &pfont_data(pfont)->Encoding;
> -     uint esize = r_size(pfe);
>       int index = -1;
>   
>       pfont->encoding_index = index;
> !     if (esize <= 256) {
>    /* Look for an encoding that's "close". */
>    int near_index = -1;
>    uint best = esize / 3; /* must match at least this many */
> --- 448,457 ----
>   {
>       const ref *pfe = &pfont_data(pfont)->Encoding;
>       int index = -1;
>   
>       pfont->encoding_index = index;
> !     if (r_type(pfe) == t_array && r_size(pfe) <= 256) {
>    /* Look for an encoding that's "close". */
> +  uint esize = r_size(pfe);
>    int near_index = -1;
>    uint best = esize / 3; /* must match at least this many */
> ***************
> *** 567,570 ****
> --- 567,571 ----
>    if (!(options & bf_Encoding_optional))
>        return_error(e_invalidfont);
> +  pencoding = 0;
>       } else {
>    if (!r_is_array(pencoding))
> 
> _______________________________________________
> gs-code-review mailing list
> [email protected]
> http://www.ghostscript.com/mailman/listinfo/gs-code-review
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.