Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
06af02b5
Commit
06af02b5
authored
Jul 04, 2006
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11vnc: check all XKeysymToString() return values.
parent
93ca945a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
21 deletions
+36
-21
README
x11vnc/README
+1
-1
keyboard.c
x11vnc/keyboard.c
+24
-11
pointer.c
x11vnc/pointer.c
+7
-5
xwrappers.c
x11vnc/xwrappers.c
+4
-4
No files found.
x11vnc/README
View file @
06af02b5
x11vnc
README
file
Date
:
Tue
Jul
4
1
8
:
26
:
52
EDT
2006
x11vnc
README
file
Date
:
Tue
Jul
4
1
9
:
28
:
31
EDT
2006
The
following
information
is
taken
from
these
URLs
:
The
following
information
is
taken
from
these
URLs
:
...
...
x11vnc/keyboard.c
View file @
06af02b5
...
@@ -104,6 +104,7 @@ void clear_modifiers(int init) {
...
@@ -104,6 +104,7 @@ void clear_modifiers(int init) {
for
(
i
=
minkey
;
i
<=
maxkey
;
i
++
)
{
for
(
i
=
minkey
;
i
<=
maxkey
;
i
++
)
{
for
(
j
=
0
;
j
<
syms_per_keycode
;
j
++
)
{
for
(
j
=
0
;
j
<
syms_per_keycode
;
j
++
)
{
char
*
str
;
keysym
=
keymap
[
(
i
-
minkey
)
*
syms_per_keycode
+
j
];
keysym
=
keymap
[
(
i
-
minkey
)
*
syms_per_keycode
+
j
];
if
(
keysym
==
NoSymbol
||
!
ismodkey
(
keysym
))
{
if
(
keysym
==
NoSymbol
||
!
ismodkey
(
keysym
))
{
continue
;
continue
;
...
@@ -114,7 +115,9 @@ void clear_modifiers(int init) {
...
@@ -114,7 +115,9 @@ void clear_modifiers(int init) {
}
}
keycodes
[
kcount
]
=
keycode
;
keycodes
[
kcount
]
=
keycode
;
keysyms
[
kcount
]
=
keysym
;
keysyms
[
kcount
]
=
keysym
;
keystrs
[
kcount
]
=
strdup
(
XKeysymToString
(
keysym
));
str
=
XKeysymToString
(
keysym
);
if
(
!
str
)
str
=
"null"
;
keystrs
[
kcount
]
=
strdup
(
str
);
kcount
++
;
kcount
++
;
}
}
}
}
...
@@ -920,7 +923,7 @@ void switch_to_xkb_if_better(void) {
...
@@ -920,7 +923,7 @@ void switch_to_xkb_if_better(void) {
char
*
str
=
XKeysymToString
(
keysym
);
char
*
str
=
XKeysymToString
(
keysym
);
fprintf
(
stderr
,
"- high keysym mapping"
fprintf
(
stderr
,
"- high keysym mapping"
": at %3d j=%d "
": at %3d j=%d "
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
}
}
}
}
continue
;
continue
;
...
@@ -929,7 +932,7 @@ void switch_to_xkb_if_better(void) {
...
@@ -929,7 +932,7 @@ void switch_to_xkb_if_better(void) {
if
(
debug_keyboard
>
1
)
{
if
(
debug_keyboard
>
1
)
{
char
*
str
=
XKeysymToString
(
must
);
char
*
str
=
XKeysymToString
(
must
);
fprintf
(
stderr
,
"- at %3d j=%d found "
fprintf
(
stderr
,
"- at %3d j=%d found "
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
"'%s'
\n
"
,
i
,
j
,
str
?
str
:
"null"
);
}
}
/* n.b. do not break, see syms_gt_4 above. */
/* n.b. do not break, see syms_gt_4 above. */
gotit
=
1
;
gotit
=
1
;
...
@@ -1348,14 +1351,16 @@ xkbmodifiers[] For the KeySym bound to this (keycode,group,level) store
...
@@ -1348,14 +1351,16 @@ xkbmodifiers[] For the KeySym bound to this (keycode,group,level) store
}
}
if
(
debug_keyboard
>
1
)
{
if
(
debug_keyboard
>
1
)
{
char
*
str
;
fprintf
(
stderr
,
" %03d G%d L%d mod=%s "
,
fprintf
(
stderr
,
" %03d G%d L%d mod=%s "
,
kc
,
grp
+
1
,
lvl
+
1
,
bitprint
(
ms
,
8
));
kc
,
grp
+
1
,
lvl
+
1
,
bitprint
(
ms
,
8
));
fprintf
(
stderr
,
"state=%s "
,
fprintf
(
stderr
,
"state=%s "
,
bitprint
(
xkbstate
[
kc
][
grp
][
lvl
],
8
));
bitprint
(
xkbstate
[
kc
][
grp
][
lvl
],
8
));
fprintf
(
stderr
,
"ignore=%s "
,
fprintf
(
stderr
,
"ignore=%s "
,
bitprint
(
xkbignore
[
kc
][
grp
][
lvl
],
8
));
bitprint
(
xkbignore
[
kc
][
grp
][
lvl
],
8
));
str
=
XKeysymToString
(
ks
);
fprintf
(
stderr
,
" ks=0x%08lx
\"
%s
\"\n
"
,
fprintf
(
stderr
,
" ks=0x%08lx
\"
%s
\"\n
"
,
ks
,
XKeysymToString
(
ks
)
);
ks
,
str
?
str
:
"null"
);
}
}
}
}
}
}
...
@@ -1480,11 +1485,15 @@ static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
...
@@ -1480,11 +1485,15 @@ static void xkb_tweak_keyboard(rfbBool down, rfbKeySym keysym,
state
=
xkbstate
[
kc
][
grp
][
lvl
];
state
=
xkbstate
[
kc
][
grp
][
lvl
];
if
(
debug_keyboard
>
1
)
{
if
(
debug_keyboard
>
1
)
{
char
*
s1
,
*
s2
;
s1
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
kc
,
0
));
if
(
!
s1
)
s1
=
"null"
;
s2
=
XKeysymToString
(
keysym
);
if
(
!
s2
)
s2
=
"null"
;
fprintf
(
stderr
,
" got match kc=%03d=0x%02x G%d"
fprintf
(
stderr
,
" got match kc=%03d=0x%02x G%d"
" L%d ks=0x%x
\"
%s
\"
(basesym:
\"
%s
\"
)
\n
"
,
" L%d ks=0x%x
\"
%s
\"
(basesym:
\"
%s
\"
)
\n
"
,
kc
,
kc
,
grp
+
1
,
lvl
+
1
,
keysym
,
kc
,
kc
,
grp
+
1
,
lvl
+
1
,
keysym
,
s2
,
s1
);
XKeysymToString
(
keysym
),
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
kc
,
0
)));
fprintf
(
stderr
,
" need state: %s
\n
"
,
fprintf
(
stderr
,
" need state: %s
\n
"
,
bitprint
(
state
,
8
));
bitprint
(
state
,
8
));
fprintf
(
stderr
,
" ignorable : %s
\n
"
,
fprintf
(
stderr
,
" ignorable : %s
\n
"
,
...
@@ -2383,8 +2392,9 @@ static void modifier_tweak_keyboard(rfbBool down, rfbKeySym keysym,
...
@@ -2383,8 +2392,9 @@ static void modifier_tweak_keyboard(rfbBool down, rfbKeySym keysym,
}
}
if
(
debug_keyboard
)
{
if
(
debug_keyboard
)
{
char
*
str
=
XKeysymToString
(
keysym
);
rfbLog
(
"modifier_tweak_keyboard: KeySym 0x%x
\"
%s
\"
-> "
rfbLog
(
"modifier_tweak_keyboard: KeySym 0x%x
\"
%s
\"
-> "
"KeyCode 0x%x%s
\n
"
,
(
int
)
keysym
,
XKeysymToString
(
keysym
)
,
"KeyCode 0x%x%s
\n
"
,
(
int
)
keysym
,
str
?
str
:
"null"
,
(
int
)
k
,
k
?
""
:
" *ignored*"
);
(
int
)
k
,
k
?
""
:
" *ignored*"
);
}
}
if
(
k
!=
NoSymbol
)
{
if
(
k
!=
NoSymbol
)
{
...
@@ -2501,7 +2511,7 @@ static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
...
@@ -2501,7 +2511,7 @@ static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
X_UNLOCK
;
X_UNLOCK
;
fprintf
(
pipeinput_fh
,
"Keysym %d %d %u %s %s
\n
"
,
uid
,
down
,
fprintf
(
pipeinput_fh
,
"Keysym %d %d %u %s %s
\n
"
,
uid
,
down
,
keysym
,
name
,
down
?
"KeyPress"
:
"KeyRelease"
);
keysym
,
name
?
name
:
"null"
,
down
?
"KeyPress"
:
"KeyRelease"
);
fflush
(
pipeinput_fh
);
fflush
(
pipeinput_fh
);
check_pipeinput
();
check_pipeinput
();
...
@@ -2851,13 +2861,16 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
...
@@ -2851,13 +2861,16 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
isbutton
=
remap
->
isbutton
;
isbutton
=
remap
->
isbutton
;
if
(
debug_keyboard
)
{
if
(
debug_keyboard
)
{
X_LOCK
;
X_LOCK
;
char
*
str1
,
*
str2
;
str1
=
XKeysymToString
(
remap
->
before
);
str2
=
XKeysymToString
(
remap
->
after
);
rfbLog
(
"keyboard(): remapping keysym: "
rfbLog
(
"keyboard(): remapping keysym: "
"0x%x
\"
%s
\"
-> 0x%x
\"
%s
\"\n
"
,
"0x%x
\"
%s
\"
-> 0x%x
\"
%s
\"\n
"
,
(
int
)
remap
->
before
,
(
int
)
remap
->
before
,
XKeysymToString
(
remap
->
before
)
,
str1
?
str1
:
"null"
,
(
int
)
remap
->
after
,
(
int
)
remap
->
after
,
remap
->
isbutton
?
"button"
:
remap
->
isbutton
?
"button"
:
XKeysymToString
(
remap
->
after
)
);
str2
?
str2
:
"null"
);
X_UNLOCK
;
X_UNLOCK
;
}
}
break
;
break
;
...
...
x11vnc/pointer.c
View file @
06af02b5
...
@@ -121,6 +121,7 @@ static void buttonparse(int from, char **s) {
...
@@ -121,6 +121,7 @@ static void buttonparse(int from, char **s) {
/*
/*
* XXX may not work with -modtweak or -xkb
* XXX may not work with -modtweak or -xkb
*/
*/
char
*
str
;
X_LOCK
;
X_LOCK
;
kcode
=
XKeysymToKeycode
(
dpy
,
ksym
);
kcode
=
XKeysymToKeycode
(
dpy
,
ksym
);
...
@@ -143,9 +144,10 @@ static void buttonparse(int from, char **s) {
...
@@ -143,9 +144,10 @@ static void buttonparse(int from, char **s) {
modisdown
[
kcode
]
=
1
;
modisdown
[
kcode
]
=
1
;
}
}
}
}
str
=
XKeysymToString
(
ksym
);
rfbLog
(
" event %d: keysym %s (0x%x) -> "
rfbLog
(
" event %d: keysym %s (0x%x) -> "
"keycode 0x%x down=%d up=%d
\n
"
,
n
+
1
,
"keycode 0x%x down=%d up=%d
\n
"
,
n
+
1
,
XKeysymToString
(
ksym
)
,
ksym
,
kcode
,
str
?
str
:
"null"
,
ksym
,
kcode
,
pointer_map
[
from
][
n
].
down
,
pointer_map
[
from
][
n
].
down
,
pointer_map
[
from
][
n
].
up
);
pointer_map
[
from
][
n
].
up
);
X_UNLOCK
;
X_UNLOCK
;
...
@@ -364,13 +366,13 @@ void do_button_mask_change(int mask, int button) {
...
@@ -364,13 +366,13 @@ void do_button_mask_change(int mask, int button) {
continue
;
continue
;
}
}
if
(
debug_pointer
&&
dpy
)
{
if
(
debug_pointer
&&
dpy
)
{
char
*
str
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
));
rfbLog
(
"pointer(): sending button %d "
rfbLog
(
"pointer(): sending button %d "
"down as keycode 0x%x (event %d)
\n
"
,
"down as keycode 0x%x (event %d)
\n
"
,
i
+
1
,
key
,
k
+
1
);
i
+
1
,
key
,
k
+
1
);
rfbLog
(
" down=%d up=%d "
rfbLog
(
" down=%d up=%d keysym: "
"keysym: %s
\n
"
,
down
,
up
,
"%s
\n
"
,
down
,
up
,
str
?
str
:
"null"
);
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
)));
}
}
if
(
down
)
{
if
(
down
)
{
XTestFakeKeyEvent_wr
(
dpy
,
key
,
True
,
XTestFakeKeyEvent_wr
(
dpy
,
key
,
True
,
...
...
x11vnc/xwrappers.c
View file @
06af02b5
...
@@ -547,9 +547,9 @@ static void upup_downdown_warning(KeyCode key, Bool down) {
...
@@ -547,9 +547,9 @@ static void upup_downdown_warning(KeyCode key, Bool down) {
RAWFB_RET_VOID
RAWFB_RET_VOID
if
((
down
?
1
:
0
)
==
keycode_state
[(
int
)
key
])
{
if
((
down
?
1
:
0
)
==
keycode_state
[(
int
)
key
])
{
char
*
str
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
));
rfbLog
(
"XTestFakeKeyEvent: keycode=0x%x
\"
%s
\"
is *already* "
rfbLog
(
"XTestFakeKeyEvent: keycode=0x%x
\"
%s
\"
is *already* "
"%s
\n
"
,
key
,
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
)),
"%s
\n
"
,
key
,
str
?
str
:
"null"
,
down
?
"down"
:
"up"
);
down
?
"down"
:
"up"
);
}
}
}
}
...
@@ -589,9 +589,9 @@ void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
...
@@ -589,9 +589,9 @@ void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
RAWFB_RET_VOID
RAWFB_RET_VOID
if
(
debug_keyboard
)
{
if
(
debug_keyboard
)
{
char
*
str
=
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
));
rfbLog
(
"XTestFakeKeyEvent(dpy, keycode=0x%x
\"
%s
\"
, %s)
\n
"
,
rfbLog
(
"XTestFakeKeyEvent(dpy, keycode=0x%x
\"
%s
\"
, %s)
\n
"
,
key
,
XKeysymToString
(
XKeycodeToKeysym
(
dpy
,
key
,
0
)),
key
,
str
?
str
:
"null"
,
down
?
"down"
:
"up"
);
down
?
"down"
:
"up"
);
}
}
if
(
first
)
{
if
(
first
)
{
init_track_keycode_state
();
init_track_keycode_state
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment