Menu

#13 Buffer overflow in HPDF_Page_Circle

closed
nobody
None
5
2006-11-25
2006-11-16
Anonymous
No

Hi,

I draw a filled circle and its representation in pdf file was following:

273.43738 735.40338 m
273.43738 736.73358 274.51694 737.81317 275.84714 737.81317 c
277.17734 737.81317 278.2569 736.73358 278.2569 735.40338 c
278.2569 734.07318 277.17734 732.99359 275.84714 732.99359 c
274.51694 732.99359 273.43738 734.07318 273.43738 7f

When the file was opened in Adobe Reader, there was an error message:

An unrecognized token '7f' was found.

and the page was blank.

Finally I found that the function HPDF_Page_Circle (hpdf_page_operator.c)
uses a buffer
char buf[HPDF_TMP_BUF_SIZ];
where HPDF_TMP_BUF_SIZ is 256

The last line with fourth quarter circle was incomplete and it should end with "c":
274.51694 732.99359 273.43738 734.07318 273.43738 735.40338 c

I doubled buffer size to 512 and it works ok now.
best regards
j.

Discussion

  • takeshi kanno

    takeshi kanno - 2006-11-25

    Logged In: YES
    user_id=413280
    Originator: NO

    Thanks,

    This problem was fixed at 2.0.8.

     
  • takeshi kanno

    takeshi kanno - 2006-11-25
    • status: open --> closed
     

Log in to post a comment.