<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr">patch below</div><div id="AppleMailSignature" dir="ltr">- - -</div><div id="AppleMailSignature" dir="ltr">Description: previous patch gptsync introduce a problem.</div><div id="AppleMailSignature" dir="ltr">in readline EOF case buffer is a garbage chunk, probably</div><div id="AppleMailSignature" dir="ltr">causing heap-overflow.</div><div id="AppleMailSignature" dir="ltr"><br></div><div id="AppleMailSignature" dir="ltr">Author: wangyangbo <wangyangbo@uniontech.com></div><div id="AppleMailSignature" dir="ltr"><br></div><div id="AppleMailSignature" dir="ltr">---</div><div id="AppleMailSignature" dir="ltr">The information above should follow the Patch Tagging Guidelines, please</div><div id="AppleMailSignature" dir="ltr">checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here</div><div id="AppleMailSignature" dir="ltr">are templates for supplementary fields that you might want to add:</div><div id="AppleMailSignature" dir="ltr"><br></div><div id="AppleMailSignature" dir="ltr">Origin: other</div><div id="AppleMailSignature" dir="ltr">Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000490</div><div id="AppleMailSignature" dir="ltr">Bug-Debian: https://bugs.debian.org/<bugnumber></div><div id="AppleMailSignature" dir="ltr">Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber></div><div id="AppleMailSignature" dir="ltr">Forwarded: <no|not-needed|url proving that it has been forwarded></div><div id="AppleMailSignature" dir="ltr">Reviewed-By: wangyangbo@uniontech.com</div><div id="AppleMailSignature" dir="ltr">Last-Update: 2021-12-16</div><div id="AppleMailSignature" dir="ltr"><br></div><div id="AppleMailSignature" dir="ltr">--- parted-3.4.orig/libparted/labels/gpt.c</div><div id="AppleMailSignature" dir="ltr">+++ parted-3.4/libparted/labels/gpt.c</div><div id="AppleMailSignature" dir="ltr">@@ -340,7 +340,10 @@ dmi_system_manufacturer (void)</div><div id="AppleMailSignature" dir="ltr"> </div><div id="AppleMailSignature" dir="ltr"> dmidecode = popen ("dmidecode -s system-manufacturer 2>/dev/null", "r");</div><div id="AppleMailSignature" dir="ltr"> if (getline (&manufacturer, &manufacturer_len, dmidecode) < 0) {</div><div id="AppleMailSignature" dir="ltr">- /* ignore; will return NULL */</div><div id="AppleMailSignature" dir="ltr">+ /* if read EOF, the buffer is a garbage chunk from malloc, not a string.</div><div id="AppleMailSignature" dir="ltr">+ probably cause strchr heap-overflow. so free it*/</div><div id="AppleMailSignature" dir="ltr">+ free (manufacturer);</div><div id="AppleMailSignature" dir="ltr">+ manufacturer = NULL;</div><div id="AppleMailSignature" dir="ltr"> }</div><div id="AppleMailSignature" dir="ltr"> pclose (dmidecode);</div><div id="AppleMailSignature" dir="ltr"> if (manufacturer) {</div><div><br></div><div id="AppleMailSignature" dir="ltr"></div></body></html>