Discussion:
[fricas-devel] [PATCH] support long filename in hyperdoc like other places
oldk1331
2018-10-15 11:43:17 UTC
Permalink
If environment variable "AXIOM" is longer than 128 characters
(which is quite easy to achieve), HyperDoc will segfault during
launching.

So I'm changing it to 2048, the same as other places.

I plan to add support for PATH_MAX and add checking for path
string manipulation later.

diff --git a/src/hyper/titlebar.c b/src/hyper/titlebar.c
index 0593c7c3..b80ffe06 100644
--- a/src/hyper/titlebar.c
+++ b/src/hyper/titlebar.c
@@ -299,7 +299,7 @@ static void
readTitleBarImages(void)
{
int w, h;
- char filename[128];
+ char filename[2048];
char *fricas_env_var = NULL;

fricas_env_var = getenv("AXIOM");
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Waldek Hebisch
2018-10-15 13:54:00 UTC
Permalink
Post by oldk1331
If environment variable "AXIOM" is longer than 128 characters
(which is quite easy to achieve), HyperDoc will segfault during
launching.
So I'm changing it to 2048, the same as other places.
OK, please commit.
Post by oldk1331
I plan to add support for PATH_MAX and add checking for path
string manipulation later.
diff --git a/src/hyper/titlebar.c b/src/hyper/titlebar.c
index 0593c7c3..b80ffe06 100644
--- a/src/hyper/titlebar.c
+++ b/src/hyper/titlebar.c
@@ -299,7 +299,7 @@ static void
readTitleBarImages(void)
{
int w, h;
- char filename[128];
+ char filename[2048];
char *fricas_env_var = NULL;
fricas_env_var = getenv("AXIOM");
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
--0000000000002d5066057842f2e9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">If environment variable &quot;AXIOM&quot; is longer than =
128 characters<br>
(which is quite easy to achieve), HyperDoc will segfault during<br>
launching.<br>
<br>
So I&#39;m changing it to 2048, the same as other places.<br>
<br>
I plan to add support for PATH_MAX and add checking for path<br>
string manipulation later.<br>
<br>
diff --git a/src/hyper/titlebar.c b/src/hyper/titlebar.c<br>
index 0593c7c3..b80ffe06 100644<br>
--- a/src/hyper/titlebar.c<br>
+++ b/src/hyper/titlebar.c<br>
@@ -299,7 +299,7 @@ static void<br>
=C2=A0 readTitleBarImages(void)<br>
=C2=A0 {<br>
=C2=A0 =C2=A0 =C2=A0 int w, h;<br>
-=C2=A0 =C2=A0 char filename[128];<br>
+=C2=A0 =C2=A0 char filename[2048];<br>
=C2=A0 =C2=A0 =C2=A0 char *fricas_env_var =3D NULL;<br>
<br>
=C2=A0 =C2=A0 =C2=A0 fricas_env_var =3D getenv(&quot;AXIOM&quot;);<br></div=
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;FriCAS - computer algebra system&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
Visit this group at <a href=3D"https://groups.google.com/group/fricas-devel=
">https://groups.google.com/group/fricas-devel</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />
--0000000000002d5066057842f2e9--
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Loading...