[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/mfgtools][upstream] 3 commits: Increase timeout to 10s because it takes some for ddr trainning.

Andreas Henriksson (@ah) gitlab at salsa.debian.org
Sun Dec 10 08:19:50 GMT 2023



Andreas Henriksson pushed to branch upstream at Debian On Mobile / mfgtools


Commits:
596831eb by Frank Li at 2023-11-07T11:37:34-05:00
Increase timeout to 10s because it takes some for ddr trainning.

Signed-off-by: Frank Li <Frank.Li at nxp.com>

- - - - -
de317f58 by Frank Li at 2023-11-09T12:14:49-06:00
Fixed sdps crash for some size flash.bin

memcpy size can't exceed input memory buffer size.
It is fix for 3f512a61

Signed-off-by: Frank Li <frank.li at nxp.com>

- - - - -
29a6f303 by Andreas Henriksson at 2023-12-10T09:07:52+01:00
New upstream version 1.5.141
- - - - -


2 changed files:

- libuuu/cmd.h
- libuuu/hidreport.cpp


Changes:

=====================================
libuuu/cmd.h
=====================================
@@ -106,7 +106,7 @@ protected:
 	std::string m_cmd;
 	bool m_lastcmd = false;
 	bool m_NoKeyParam = false;
-	int m_timeout = 2000;
+	int m_timeout = 10000;
 
 private:
 	std::vector<Param> m_param;
@@ -219,4 +219,4 @@ int run_cmd(CmdCtx *pCtx, const char * cmd, int dry);
 int insert_env_variable(std::string key, std::string value);
 std::string get_env_variable(std::string key);
 int clear_env();
-bool is_evn_exist(std::string key);
\ No newline at end of file
+bool is_evn_exist(std::string key);


=====================================
libuuu/hidreport.cpp
=====================================
@@ -78,6 +78,10 @@ int HIDReport::write(const void *p, size_t sz, uint8_t report_id)
 		m_out_buff[0] = report_id;
 
 		size_t s = sz - off;
+		size_t copy_sz = s;
+
+		if (copy_sz > m_size_out)
+			copy_sz = m_size_out;
 
 		/*
 		 * The Windows HIDAPI is ver strict. It always require to send
@@ -88,7 +92,8 @@ int HIDReport::write(const void *p, size_t sz, uint8_t report_id)
 		if (s > m_size_out || report_id == 2)
 			s = m_size_out;
 
-		memcpy(m_out_buff.data() + m_size_payload, buff + off, s);
+		/* copy_sz can't be bigger then input data size, otherwise access unpaged memory */
+		memcpy(m_out_buff.data() + m_size_payload, buff + off, copy_sz);
 
 		int ret = m_pdev->write(m_out_buff.data(), s + m_size_payload);
 



View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/mfgtools/-/compare/1fb325a6d169265b796c7f0cf833263845b24f11...29a6f303f65bb2fdb6b1de342d1c22bcd8c305c6

-- 
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/mfgtools/-/compare/1fb325a6d169265b796c7f0cf833263845b24f11...29a6f303f65bb2fdb6b1de342d1c22bcd8c305c6
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20231210/b824a6ce/attachment-0001.htm>


More information about the Debian-on-mobile-maintainers mailing list