@@ -163,6 +163,12 @@ static char* nr_execute_handle_autoload_composer_get_vendor_path(
163
163
char * vendor_path = NULL ; // result of dirname(filename)
164
164
char * cp = NULL ;
165
165
166
+ // nrunlikely because this should alredy be ensured by the caller
167
+ if (nrunlikely (NULL == filename )) {
168
+ nrl_verbosedebug (NRL_FRAMEWORK , "%s - filename is NULL" , __func__ );
169
+ return NULL ;
170
+ }
171
+
166
172
// vendor_path = dirname(filename):
167
173
// 1. copy filename to vendor_path
168
174
vendor_path = nr_strdup (filename );
@@ -180,6 +186,18 @@ static bool nr_execute_handle_autoload_composer_file_exists(
180
186
char * composer_magic_file = NULL ; // vendor_path + filename
181
187
bool file_exists = false;
182
188
189
+ // nrunlikely because this should alredy be ensured by the caller
190
+ if (nrunlikely (NULL == vendor_path )) {
191
+ nrl_verbosedebug (NRL_FRAMEWORK , "%s - vendor_path is NULL" , __func__ );
192
+ return false;
193
+ }
194
+
195
+ // nrunlikely because this should alredy be ensured by the caller
196
+ if (nrunlikely (NULL == filename )) {
197
+ nrl_verbosedebug (NRL_FRAMEWORK , "%s - filename is NULL" , __func__ );
198
+ return false;
199
+ }
200
+
183
201
composer_magic_file = nr_formatf ("%s/%s" , vendor_path , filename );
184
202
if (0 == nr_access (composer_magic_file , F_OK | R_OK )) {
185
203
file_exists = true;
@@ -199,6 +217,12 @@ void nr_composer_handle_autoload(const char* filename) {
199
217
#define COMPOSER_MAGIC_FILE_3_LEN (sizeof(COMPOSER_MAGIC_FILE_3) - 1)
200
218
char * vendor_path = NULL ; // result of dirname(filename)
201
219
220
+ // nrunlikely because this should alredy be ensured by the caller
221
+ if (nrunlikely (NULL == filename )) {
222
+ nrl_verbosedebug (NRL_FRAMEWORK , "%s - filename is NULL" , __func__ );
223
+ return ;
224
+ }
225
+
202
226
vendor_path = nr_execute_handle_autoload_composer_get_vendor_path (filename );
203
227
if (NULL == vendor_path ) {
204
228
nrl_verbosedebug (NRL_FRAMEWORK , "unable to get vendor path from '%s'" ,
0 commit comments