summaryrefslogtreecommitdiff
path: root/x11/libxklavier/files/patch-libxklavier_xklavier_props.c
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2006-04-03 21:30:10 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2006-04-03 21:30:10 +0000
commitdeb4736ca259cbea7769edfdae3b69cc0f20feaf (patch)
tree289e44589033b02ba611bdec92b062ae56de90e3 /x11/libxklavier/files/patch-libxklavier_xklavier_props.c
parent- Fix logging of "connect from" message (diff)
Fix a crash that could occur if any of the keyboard layouts had variants
(e.g. jp(latin) where latin the the variant of jp). The problem was a bad use of realloc. Thanks to jasone for explaining the problem with the existing code. Reported by: bland
Diffstat (limited to 'x11/libxklavier/files/patch-libxklavier_xklavier_props.c')
-rw-r--r--x11/libxklavier/files/patch-libxklavier_xklavier_props.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/x11/libxklavier/files/patch-libxklavier_xklavier_props.c b/x11/libxklavier/files/patch-libxklavier_xklavier_props.c
new file mode 100644
index 000000000000..87dffde8985b
--- /dev/null
+++ b/x11/libxklavier/files/patch-libxklavier_xklavier_props.c
@@ -0,0 +1,13 @@
+--- libxklavier/xklavier_props.c.orig Mon Apr 3 14:49:17 2006
++++ libxklavier/xklavier_props.c Mon Apr 3 17:16:13 2006
+@@ -319,7 +324,9 @@ Bool XklGetNamesProp( Atom rulesAtom,
+ memcpy( var, varstart + 1, --varlen );
+ var[varlen] = '\0';
+
+- ( (char*)realloc( *theLayout, laylen + 1 ) )[laylen] = '\0';
++ *theLayout = realloc (*theLayout, laylen + 1);
++ (*theLayout)[laylen] = '\0';
++ /*( (char*)realloc( *theLayout, laylen + 1 ) )[laylen] = '\0';*/
+ }
+ }
+ }