mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-29 12:41:03 +00:00
Fix mg_sntp_parse()
This commit is contained in:
1 parent
1b551741b8
commit
30d4a1ad0f
5 files changed
+19
-4
No files matched your search
+1
-1
@@ -10,7 +10,7 @@
|
||||
static unsigned long s_sntmp_next;
|
||||
|
||||
int mg_sntp_parse(const unsigned char *buf, size_t len, struct timeval *tv) {
|
||||
int mode = buf[0] & 7, res = -1;
|
||||
int mode = len > 0 ? buf[0] & 7 : 0, res = -1;
|
||||
if (len < 48) {
|
||||
LOG(LL_ERROR, ("%s", "corrupt packet"));
|
||||
} else if ((buf[0] & 0x38) >> 3 != 4) {
|
||||
|
||||
Reference in new issue
Block a user