libvirt List Archives
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
thread

Eustance Wu

15 Jun 2022 15 Jun '22
11:01 p.m.
...

From 7df034e93d392c734ac5c4f4148a3d05f9edce29 Mon Sep 17 00:00:00 2001 From: WuLongTao <eustancewu@gmail.com> Date: Thu, 16 Jun 2022 10:43:29 +0800 Subject: [PATCH] virMacAddrParse: Fix wrong termination character

The judgment of the termination character should be the null character, not a space. Using spaces to judge, content can be injected into mac. such as: "70:af:e7:1f:3f:89\001 injected". This will result in an error: "virNetSocketReadWire:1805 : End of file while reading data: Input/output error" --- src/util/virmacaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c index 6b22384cee..5c4aa07713 100644 --- a/src/util/virmacaddr.c +++ b/src/util/virmacaddr.c @@ -163,7 +163,7 @@ virMacAddrParse(const char* str, virMacAddr *addr) addr->addr[i] = (unsigned char) result; - if ((i == 5) && (*end_ptr <= ' ')) + if ((i == 5) && (*end_ptr <= 0)) return 0; if (*end_ptr != ':') break; -- 2.32.0

Attachments:

  • attachment.html (text/html — 1.3 KB)
0 0
Reply
Sign in to reply online Use email software

Back to the thread

Back to the list

HyperKitty Powered by HyperKitty version 1.3.12.