<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> I have spotted one potential hole though: the method<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
AccountNumberCheck::callback() should check that at least the expected number<br>
of arguments are in argv before processing them in readDatabase(). If for<br>
whatever reason less than the 7 arguments are passed, readDatabase() will<br>
access invalid memory. </blockquote><div>Yes, this does make sense. I will fix it.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Besides that, I wonder what is passed as argv[0].</div></blockquote><div>It's the first column of the database; the country code. Right now it is not being used.</div><div>It'll be required when support for additional countries are added.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Did you blog about your work somewhere?</div></blockquote><div>Finishing it up. Will publish in a day or two. </div><div><br></div><div>Thanks for reviewing.</div><div>Prasun<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 20 Jun 2020 at 23:38, Thomas Baumgart <<a href="mailto:thb@net-bembel.de">thb@net-bembel.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Prasun,<br>
<br>
On Freitag, 19. Juni 2020 08:14:44 CEST Prasun Kumar wrote:<br>
<br>
> Hi everyone,<br>
> I have pushed the commits of my work in Week 2 and 3 of this project. The<br>
> code now reads data from the SQLite DB and I have also added support for<br>
> validity period checking.<br>
> I have added comments by trying to follow the convention of the current<br>
> code, but do let me know if I missed anything.<br>
<br>
This looks generally OK to me. I have spotted one potential hole though: the method<br>
AccountNumberCheck::callback() should check that at least the expected number<br>
of arguments are in argv before processing them in readDatabase(). If for<br>
whatever reason less than the 7 arguments are passed, readDatabase() will<br>
access invalid memory. Besides that, I wonder what is passed as argv[0].<br>
<br>
You should also make sure that the pointers passed by argv are not zero before<br>
using them. They can be as a result of the data contained in the database.<br>
<br>
See <a href="https://www.sqlite.org/c3ref/exec.html" rel="noreferrer" target="_blank">https://www.sqlite.org/c3ref/exec.html</a> for details.<br>
<br>
> Note: I have disabled the ctest benchmark for now as it requires some work<br>
> which I plan to do this week.<br>
> Please take a look at the code and if anything is out of place, please let<br>
> me know.<br>
<br>
Done, see above. Keep going. Did you blog about your work somewhere?<br>
<br>
-- <br>
<br>
Regards<br>
<br>
Thomas Baumgart<br>
<br>
<a href="https://www.signal.org/" rel="noreferrer" target="_blank">https://www.signal.org/</a>       Signal, the better WhatsApp<br>
-------------------------------------------------------------<br>
I'm playing in a band called 999 MB.<br>
We haven't gotten a gig yet.<br>
-------------------------------------------------------------<br>
</blockquote></div>