Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] beginner question about code using malloc


  • Subject: [Frama-c-discuss] beginner question about code using malloc
  • From: holger.ki at freenet.de (Holger Kiskowski)
  • Date: Sun, 3 Jun 2018 19:46:14 +0200
  • In-reply-to: <20180603102628.GA2254@localhost>
  • References: <20180603102628.GA2254@localhost>

* Holger Kiskowski <holger.ki at freenet.de> wrote:
> How can I verify this C program using frama-c?
> 
> #include <stdlib.h>
> 
> int main(void)
> {
>   char *p = malloc(2);
>   char s[2];
>   p[0] = 0;
>   s[0] = 0;
>   return 0;
> }

I take the question back.
If I guard against malloc returning NULL, EVA is indeed able to see the
write being in-bounces! :-)

The malloc implementation I use does never return NULL (embedded code).
So I can just use a custom malloc spec, where I remove the "or NULL"
case.

Sorry for the noise. :-)

Holger