Re: [fricas-devel] [PATCH] fix title related memory issues

2024-05-26 Thread Waldek Hebisch
On Sun, May 26, 2024 at 09:04:27PM +0800, Qian Yun wrote: > See my updated attachment. > > In this version I did not try to do cleanups, instead I > declare errorStr as local variable. > > As for "check", I find that it gets redefined in > graph/viewAlone/viewAlone.h, graph/viewman/viewman.h: >

Re: [fricas-devel] [PATCH] fix title related memory issues

2024-05-26 Thread Qian Yun
See my updated attachment. In this version I did not try to do cleanups, instead I declare errorStr as local variable. As for "check", I find that it gets redefined in graph/viewAlone/viewAlone.h, graph/viewman/viewman.h: #define check(code) checker(code,__LINE__,"") Also I don't like its

Re: [fricas-devel] [PATCH] fix title related memory issues

2024-05-26 Thread Waldek Hebisch
On Sat, May 25, 2024 at 06:27:10PM +0800, Qian Yun wrote: > Sorry, the problem is not "fricas_sprintf_to_buf", but > "extern char errorStr [80];". > > I want to avoid this global variable and implementation > detail to leak to util.c. So you are trying to clean up the code. I must say that I

Re: [fricas-devel] [PATCH] fix title related memory issues

2024-05-25 Thread Qian Yun
Sorry, the problem is not "fricas_sprintf_to_buf", but "extern char errorStr [80];". I want to avoid this global variable and implementation detail to leak to util.c. - Qian On 5/24/24 23:40, Waldek Hebisch wrote: On Fri, May 24, 2024 at 05:04:08PM +0800, Qian Yun wrote: I wanted to avoid

Re: [fricas-devel] [PATCH] fix title related memory issues

2024-05-24 Thread Waldek Hebisch
On Fri, May 24, 2024 at 05:04:08PM +0800, Qian Yun wrote: > I wanted to avoid pulling in "fricas_sprintf_to_buf". > > Turns out I can use > > const char *errorStr = "read from viewport manager\n"; > > Are you OK with this? OK if we really need to remove uses of "fricas_sprintf_to_buf". But

Re: [fricas-devel] [PATCH] fix title related memory issues

2024-05-24 Thread Qian Yun
I wanted to avoid pulling in "fricas_sprintf_to_buf". Turns out I can use const char *errorStr = "read from viewport manager\n"; Are you OK with this? - Qian On 5/24/24 07:19, Waldek Hebisch wrote: It is good to fix buffer overflow. But you also remove error checking (use of 'check').

Re: [fricas-devel] [PATCH] fix title related memory issues

2024-05-23 Thread Waldek Hebisch
On Wed, May 22, 2024 at 10:10:16PM +0800, Qian Yun wrote: > This patch fixes many memory issues related with title -- > especially with long titles in graphs. > > The fix includes: > > 1. memory overwrite in 'spadAction' > > (1) -> vp := draw(x,x=1..2); title(vp, new(100, "a".1)$String) >

[fricas-devel] [PATCH] fix title related memory issues

2024-05-22 Thread Qian Yun
This patch fixes many memory issues related with title -- especially with long titles in graphs. The fix includes: 1. memory overwrite in 'spadAction' (1) -> vp := draw(x,x=1..2); title(vp, new(100, "a".1)$String) Compiling function %C with type DoubleFloat -> DoubleFloat Graph data