Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
92c1bd11
Commit
92c1bd11
authored
Dec 16, 1991
by
Per Cederqvist
Browse files
Check the length of all string arguments to all atomic functions.
parent
48dff312
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/server/ChangeLog
View file @
92c1bd11
Mon Dec 16 15:32:57 1991 Per Cederqvist (ceder at ruben)
* admin.c (broadcast, send_message): Don't forget to check the
length of the message.
* text.c (create_text, create_anonymous_text): Fixed error in max
length comparison.
* All the changes below fixes one single bug. When a text is
created that has both a secret and a public conference as
recipient the asynchronous messages that were sent out did not
...
...
src/server/admin.c
View file @
92c1bd11
/*
* $Id: admin.c,v 0.
5
1991/
09
/1
5
1
0:33:25 linus
Exp $
* $Id: admin.c,v 0.
6
1991/
12
/1
6
1
7:44:22 ceder
Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -28,7 +28,7 @@
* Administrative calls.
*/
static
char
*
rcsid
=
"$Id: admin.c,v 0.
5
1991/
09
/1
5
1
0:33:25 linus
Exp $"
;
static
char
*
rcsid
=
"$Id: admin.c,v 0.
6
1991/
12
/1
6
1
7:44:22 ceder
Exp $"
;
#include
<stdlib.h>
#include
"lyskomd.h"
...
...
@@ -138,6 +138,12 @@ broadcast (String message)
{
CHK_LOGIN
(
FAILURE
);
if
(
s_strlen
(
message
)
>
BROADCAST_LEN
)
{
kom_errno
=
KOM_LONG_STR
;
return
FAILURE
;
}
async_broadcast
(
ACTPERS
,
message
);
return
OK
;
}
...
...
@@ -151,6 +157,12 @@ send_message (Pers_no recipient,
{
CHK_LOGIN
(
FAILURE
);
if
(
s_strlen
(
message
)
>
BROADCAST_LEN
)
{
kom_errno
=
KOM_LONG_STR
;
return
FAILURE
;
}
return
async_send_message
(
recipient
,
ACTPERS
,
message
);
}
...
...
src/server/text.c
View file @
92c1bd11
/*
* $Id: text.c,v 0.1
1
1991/12/16 1
6
:4
3:51
ceder Exp $
* $Id: text.c,v 0.1
2
1991/12/16 1
7
:4
4:19
ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
...
...
@@ -28,7 +28,7 @@
* All atomic calls that deals with texts.
*/
static
char
*
rcsid
=
"$Id: text.c,v 0.1
1
1991/12/16 1
6
:4
3:51
ceder Exp $"
;
static
char
*
rcsid
=
"$Id: text.c,v 0.1
2
1991/12/16 1
7
:4
4:19
ceder Exp $"
;
#include
<time.h>
#include
<stdlib.h>
...
...
@@ -1762,7 +1762,7 @@ create_text(String message,
/* Check the length of the text. */
if
(
s_strlen
(
message
)
>
=
TEXT_LEN
)
if
(
s_strlen
(
message
)
>
TEXT_LEN
)
{
kom_errno
=
KOM_LONG_STR
;
return
0
;
...
...
@@ -1835,7 +1835,7 @@ create_anonymous_text(String message,
/* Check the length of the text. */
if
(
s_strlen
(
message
)
>
=
TEXT_LEN
)
if
(
s_strlen
(
message
)
>
TEXT_LEN
)
{
kom_errno
=
KOM_LONG_STR
;
return
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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