shithub: rgbds

Download patch

ref: c0859e64f71a603be9feacd55dceaabdf7b45519
parent: 3e0b7d428f7a600ab9d899996176a2b514b116e2
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Tue Apr 13 05:31:05 EDT 2021

fstk_FindFile checks for sprintf failure

--- a/src/asm/fstack.c
+++ b/src/asm/fstack.c
@@ -191,6 +191,11 @@
 					break;
 				}
 				len = sprintf(*fullPath, "%s%s", incPath, path);
+				if (len < 0) {
+					error("sprintf error during include path search: %s\n",
+					       strerror(errno));
+					break;
+				}
 			}
 
 			if (isPathValid(*fullPath)) {