Skip to content

Instantly share code, notes, and snippets.

@QiuYitai
Created June 23, 2025 01:13
Show Gist options
  • Select an option

  • Save QiuYitai/6ebfa07510828a9464ba7fb948255ed5 to your computer and use it in GitHub Desktop.

Select an option

Save QiuYitai/6ebfa07510828a9464ba7fb948255ed5 to your computer and use it in GitHub Desktop.
Description of the null pointer vulnerability in c-ray 1.1
Version:1.1
Discoverer:WeiBin Qiu<24210240277@m.fudan.edu.cn>
Affected Component:common/loaders/formats/wavefront/mtlloader.c,struct mesh_material_arr parse_mtllib,current
Reference:https://github.com/vkoskiv/c-ray/issues/119
Description:
The NULL Dereference vulnerability happens in struct mesh_material_arr parse_mtllib(), common/loaders/formats/wavefront/mtlloader.c
How the NULL Pointer Dereference happens:
1. current is set to NULL at struct material *current = NULL;
2. NULL dereference of variable current happens at current->IOR = atof(nextToken(&line));
struct mesh_material_arr parse_mtllib(const char *filePath)
{
......
struct material *current = NULL;
......
while (head) {
......
if (first[0] == '#') {
head = nextLine(file);
continue;
}......
=> else if (stringEquals(first, "Ni")) {
=> current->IOR = atof(nextToken(&line));
}
......
}
......
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment