Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
842bd481
Commit
842bd481
authored
1 year ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Fix obvious errors found by Coverity.
A couple were actually serious, most were unimportant.
parent
2dd514d0
No related branches found
No related tags found
No related merge requests found
Pipeline
#5814
passed
1 year ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conio/curs_cio.c
+1
-3
1 addition, 3 deletions
src/conio/curs_cio.c
src/syncterm/ssh.c
+16
-6
16 additions, 6 deletions
src/syncterm/ssh.c
with
17 additions
and
9 deletions
src/conio/curs_cio.c
+
1
−
3
View file @
842bd481
...
...
@@ -695,9 +695,7 @@ int curs_vmem_gettext(int sx, int sy, int ex, int ey, struct vmem_cell *fill)
fill
[
fillpos
].
ch
=
(
unsigned
char
)(
thischar
);
attrib
=
0
;
if
(
attr
&
WA_BOLD
)
{
if
(
thischar
==
' '
)
thischar
=
0
;
else
if
(
thischar
!=
' '
)
attrib
|=
8
;
}
if
(
attr
&
WA_BLINK
)
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/ssh.c
+
16
−
6
View file @
842bd481
...
...
@@ -69,7 +69,7 @@ cryptlib_error_message(int status, const char *msg)
{
char
str
[
64
];
char
str2
[
64
];
char
*
errmsg
;
char
*
errmsg
=
NULL
;
int
err_len
;
bool
err_written
=
false
;
...
...
@@ -86,8 +86,8 @@ cryptlib_error_message(int status, const char *msg)
sprintf
(
str2
,
"Error %d %s"
,
status
,
msg
);
uifcmsg
(
str2
,
errmsg
);
err_written
=
true
;
free
(
errmsg
);
}
free
(
errmsg
);
}
}
if
(
!
err_written
)
{
...
...
@@ -249,7 +249,7 @@ ssh_input_thread(void *args)
if
(
chan
==
-
1
)
{
if
(
sftp_channel
!=
-
1
)
{
FlushData
(
ssh_session
);
status
=
cryptSetAttribute
(
ssh_session
,
CRYPT_SESSINFO_SSH_CHANNEL
,
s
sh
_channel
);
status
=
cryptSetAttribute
(
ssh_session
,
CRYPT_SESSINFO_SSH_CHANNEL
,
s
ftp
_channel
);
if
(
status
==
CRYPT_ERROR_NOTFOUND
)
{
chan
=
sftp_channel
;
}
...
...
@@ -259,7 +259,7 @@ ssh_input_thread(void *args)
}
if
(
cryptStatusError
(
popstatus
))
{
if
(
chan
==
-
1
||
(
popstatus
==
CRYPT_ERROR_COMPLETE
)
||
(
popstatus
==
CRYPT_ERROR_READ
)
)
{
/* connection closed */
if
(
chan
==
-
1
)
{
/* connection closed */
pthread_mutex_lock
(
&
ssh_mutex
);
status
=
cryptSetAttribute
(
ssh_session
,
CRYPT_SESSINFO_SSH_CHANNEL
,
chan
);
if
(
status
!=
CRYPT_ERROR_NOTFOUND
)
{
...
...
@@ -316,6 +316,9 @@ ssh_input_thread(void *args)
}
}
}
else
{
pthread_mutex_unlock
(
&
ssh_mutex
);
}
}
FlushData
(
ssh_session
);
}
...
...
@@ -524,14 +527,17 @@ add_public_key(void *vpriv)
status
=
cryptSetAttribute
(
ssh_session
,
CRYPT_SESSINFO_SSH_CHANNEL
,
ssh_channel
);
if
(
cryptStatusOK
(
status
))
status
=
cryptGetAttribute
(
ssh_session
,
CRYPT_SESSINFO_SSH_CHANNEL_ACTIVE
,
&
active
);
if
(
cryptStatusOK
(
status
)
&&
active
)
{
pthread_mutex_unlock
(
&
ssh_mutex
);
break
;
}
}
pthread_mutex_unlock
(
&
ssh_mutex
);
if
(
cryptStatusOK
(
status
)
&&
active
)
break
;
SLEEP
(
10
);
};
if
(
!
active
)
{
pubkey_thread_running
=
false
;
free
(
priv
);
return
;
}
pthread_mutex_lock
(
&
ssh_tx_mutex
);
...
...
@@ -657,6 +663,7 @@ add_public_key(void *vpriv)
}
else
{
pthread_mutex_unlock
(
&
ssh_mutex
);
pthread_mutex_unlock
(
&
ssh_tx_mutex
);
}
free
(
priv
);
pubkey_thread_running
=
false
;
...
...
@@ -1000,6 +1007,9 @@ ssh_connect(struct bbslist *bbs)
pubkey_thread_running
=
true
;
_beginthread
(
add_public_key
,
0
,
pubkey
);
}
else
{
free
(
pubkey
);
}
if
(
!
bbs
->
hidepopups
)
uifc
.
pop
(
NULL
);
// TODO: Why is this called twice?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment