Signed integer overflow in function `compute_ellarc`
Fixed with commit [6919a3].
The second argument to strchr() is an int, which will be cast to a char. With 67 + 128, the value will be larger than can be held by a signed char (most probably stored correctly, but not defined by the standard). With 67 + '/200' the resulting value depends on the signedness of the char, which, as I read it, is the behaviour as intended by the author.
Replace sqrt(x*x + y*y) by hypot(x, y), ticket #199
Good point, also, hypot() is not used anywhere in the code. I changed the sqrt(..) in a number of places to hypot, but need to check a bit before committing.
bound.c: invalid value passed to `strchr`
Signed integer overflow in function `compute_ellarc`
Adding the conversion was quite involved. I currently do not see a possibility to optionally disable that code, although such possibility might exist. Both xfig and the fig2dev backend program have options to tune the behaviour with respect to encoding: Xfig has the -nointernational option, fig2dev has an -E (enc) option to force an input encoding. Can the problems be mitigated with these options?
Hello, we use xfig for documentation and the change from latin1 to utf-8 causes some problems. Is it possible to add an option fallback to the old latin1 format ?
Add feature test macros
Avoid compilation warnings
README refers to nonexistent Fig.ad
Rererences were corrected and the .ad extension removed, see commit [edd2cd].
Remove .ad extension from app-defaults files, #197
[Patch] Fix typo in export menu
Thank you, applied with commit [396dff].
Fix typo for GERBER export menu
I think a superior solution is to remove the .ad extension from all files and from the references to those files. I did not find an .ad extension elsewhere.
[Patch] Fix typo in export menu
README refers to nonexistent Fig.ad
Small radius circles not rasterised
thanks,
Small radius circles not rasterised
The behaviour as reported was introduced with commit [c4465e] and affects the development version of fig2dev. In my tests with fig2dev 3.2.9a, all three circles described above rendered correctly. Commit [d8e1ce] now partially reverts the commit mentioned above. This issue reveals a faulty design decision made previously with commit [c4465e]. Luckily, it was discovered quickly. Originally, one of the output backends of fig2dev would have problems with too small circles. Initially it was thought that...
Correct line counting in fig files
Allow circles with small radius, ticket #196
Small radius circles not rasterised
Crash while editing text element
The issue can be avoided with commit [35899d] by applying Athena Translations only to the text widget, not to the scrollbar, Text.translations instead of Text*translations. The issue is also fixed upstreams in libxaw3d.
Avoid some compilation warnings
SEGV on read_arcobject()
The issue was suppressed with commit [1e5515], and really resolved with [c4465e].
stack-overflow on bezier_spline()
Commit [dfa8b6] fixes this issue.
SEGV on genge_itp_spline()
Fixed with commit [2bd6c0].
stack-buffer-overflow on read_objects()
Fixed with commit [5f2200].
heap-buffer-overflow on StrstrCheck()
Fixed with commit [818cc1].
Detect nan in spline control values, ticket #192
ge output: correct spline computation, ticket #190
Permit \0 in the second line in the fig file, #191
Recognize a text object with an empty string, #195
Wrap more fprintf() and fputc() into error-reporting functions
Replace putc() and fputc() by putc_out()
Replace many print_out(fmt) by puts_out(fmt)
Replace fputs(.., tfp) by puts_out(..)
Add error handling to fprintf(tfp,..): print_out(..)
Simplify err_msg()
Rename from and to to fromname and toname
heap-buffer-overflow on StrstrCheck()
Yes, I pulled the changes for xfig from the repository given in https://sourceforge.net/p/mcj/fig2dev/merge-requests/1/. I set the status of this merge request to "merged", since it's content is now contained in xfig.
Fix prototypes for modern C
After rebasing I learnt you already had cherry-picked my commits during February after the discussion in https://sourceforge.net/p/mcj/fig2dev/merge-requests/1/. So this merge request if effectively empty. Sorry for the noise.
Please, first pull the actual state of master on xfig and rebase the branch prototypes on it On the xfig repository, if tried to merge into a temporary branch based on master. This gave plenty of "Auto-merging ..." messages, indicating that the commits do not introduce new changes, and some merge conflicts. git switch master git branch prototypes git pull git://git.code.sf.net/u/hamarituc/xfig prototypes
Fix prototypes for modern C
CVE-2025-31164
CVE-2025-31163
CVE-2025-31162
Use feature test macros
Replace usleep() by nanosleep()
Wrap random() and srandom() into xf_(s)random()
Include a missing header, for M_PI
Remove isascii(), anyhow it was called unnecessarily
Avoid intptr_t, it is optional in C
Reverse thumb movement direction in the color editor
Remove intptr_t from w_color.c
Use S_ISDIR() and S_IWUSR instead of S_IFDIR and S_IWRITE
Refactor make_pulldown_menu_separator()
Split make_pulldown_menu() into two functions
Avoid caddr_t - it might become obsolete
Avoid gcc -Wcast-function-type warnings
Let locate_menu() return a valid error-code
Above patch is applied with commit [d9f210]. However, if I compile with gcc -std=c23, compilation still fails with errors, e.g., error: unknown type name 'caddr_t'. Hence, I will keep this ticket open and see, whether all issues regarding c23 can be resolved.
Change variable names true/false, which conflict in GCC-15 (C23 standard) with predefined keywords.
The attached patch should fix the above mentioned problem with true/false variable names. Using this with in combination with current GIT tree allows to compile xfig with GCC 15.
I just noticed, that Mario Haustein already fixed the prototypes in GIT. But when I try to build the GIT version with GCC-15, I still run into the following error: main.c:123:17: error: expected identifier or '(' before 'true' 123 | static Boolean true = True; | ^~~~ main.c:124:17: error: expected identifier or '(' before 'false' 124 | static Boolean false = False; | ^~~~~ main.c:198:66: error: lvalue required as unary '&' operand 198 | XtOffset(appresPtr, allownegcoords), XtRBoolean, (caddr_t) &...
fig2dev: incompatible with GCC 15 C23 standard
I just noted, that https://sourceforge.net/p/mcj/fig2dev/ci/ab4eee3cf0d0c1d861d64b9569a5d1497800cae2/ already fixes this issue.
Remove checks for strndup() as it is not needed
Fix miscellaneous prototypes
Fix X callback prototypes
Fix prototypes for manipulation callbacks
Fix prototypes for moving callbacks
Remove obsolete declarations
Fix old style definitions
Fix prototypes for keyboard callbacks
Fix prototypes for mouse button callbacks
Report errors when writing .xfigrc file
Report errors when writing file for spell check
Declare local functions as static in w_style.c
Report failure to write style file
Detect failure when saving fig-file
Remove version 4.0 code
xfig: incompatible with GCC 15 C23 standard
fig2dev: incompatible with GCC 15 C23 standard
stack-overflow on bezier_spline()
thanks again :-) Andrew On 11/02/2025 8:57 pm, tkl wrote: Keeping this ticket open, to remember - to add gswin64c to the executables searched for during ./configure - add an environment variable, e.g, FIG2DEV_GS, to give the user the possibility to override the path to ghostscript, - probably contact cygwin to patch their current xfig distribution. [tickets:#189] https://sourceforge.net/p/mcj/tickets/189/ pdf export does not work Status: open Created: Sat Feb 08, 2025 06:41 AM UTC by Andrew Paplinski...