You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for commit 21cff3b clang static analyzer does complain about line 7783
'memcpy(end, begin, count * sizeof(xpath_node));'
'_end: Null pointer passed as an argument to a 'nonnull' parameter'
I'm not sure, how this can happen. One possibility would be that nothing is in there yet. size_ is 0 and end is 0. Now calling append with begin = end_ does not allocate any memory and memcpy will be called with _end = 0 and count = 0. I'm not sure what memcpy is doing when nothing (count=0) is to be copied to NULL, but clang is complaining.
One simple solution would be checking at the very beginning whether begin_ == end_. In this case nothing is to be done => return.
regards,
Matthias
The text was updated successfully, but these errors were encountered:
for commit 21cff3b clang static analyzer does complain about line 7783
'memcpy(end, begin, count * sizeof(xpath_node));'
'_end: Null pointer passed as an argument to a 'nonnull' parameter'
I'm not sure, how this can happen. One possibility would be that nothing is in there yet. size_ is 0 and end is 0. Now calling append with begin = end_ does not allocate any memory and memcpy will be called with _end = 0 and count = 0. I'm not sure what memcpy is doing when nothing (count=0) is to be copied to NULL, but clang is complaining.
One simple solution would be checking at the very beginning whether begin_ == end_. In this case nothing is to be done => return.
regards,
Matthias
The text was updated successfully, but these errors were encountered: