aboutsummaryrefslogtreecommitdiff
path: root/pcap-rpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-03-22 19:07:11 -0700
committerGuy Harris <guy@alum.mit.edu>2018-03-22 19:07:11 -0700
commit1c43ff384d71991e2a4b7436f452deea1e1b2c85 (patch)
tree5baaa75a258625072b4e8801d2a6c100cd2ef561 /pcap-rpcap.c
parent515613b5f41227af768f9315b0065d3401e0f38b (diff)
Don't set auth_type until we know it's a type we support.
If it is, we know it fits into a uint16; cast the assignment to squelch a warning.
Diffstat (limited to 'pcap-rpcap.c')
-rw-r--r--pcap-rpcap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap-rpcap.c b/pcap-rpcap.c
index 823a1833..8d4a64e7 100644
--- a/pcap-rpcap.c
+++ b/pcap-rpcap.c
@@ -1888,8 +1888,6 @@ static int rpcap_sendauth(SOCKET sock, uint8 *ver, struct pcap_rmtauth *auth, ch
if (auth)
{
- auth_type = auth->type;
-
switch (auth->type)
{
case RPCAP_RMTAUTH_NULL:
@@ -1924,6 +1922,8 @@ static int rpcap_sendauth(SOCKET sock, uint8 *ver, struct pcap_rmtauth *auth, ch
pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, "Authentication type not recognized.");
return -1;
}
+
+ auth_type = (uint16)auth->type;
}
else
{