Hello everyone!
I am an aspiring new contributor (github id: ashamedbit) to tinycc. I was just 
studying the code and hunting for bugs in tinycc that I wanted to get your 
opinion on:

In the function tcc_debug_start in tccdbg.c
https://github.com/TinyCC/tinycc/blob/fada98b1ce9ee0c36771183177218828ccb9b9de/tccdbg.c#L1135-L1138
If getcwd fails then variable buf is uninitialized.
Subsequently variable buf is used in other places like lines 1137 and 1204
The fix should check return value of getcwd before using variable buf.


In the function pstrcpy, I believe there should be a null check for pointer s.
https://github.com/TinyCC/tinycc/blob/fada98b1ce9ee0c36771183177218828ccb9b9de/libtcc.c#L147-L166
The function is called in a lot of places and this can possibly lead to null 
pointer dereference, especially at this point (when s is null)
c = *s++;

Thank you for your time and patience!

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to