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

Bug#1054018: splint: small bug example



Package: splint
Version: 1:3.1.2+dfsg-5
Followup-For: Bug #1054018

Dear Maintainer,

I analyze file limited_main.c
-------------------------------------------------- limited_main.c
typedef struct livre {
    int num;
    char * titre;
    char * auteur;
    struct livre * suiv;
} Livre;

typedef struct {
    Livre * L;
} Biblio;

Biblio *charger_n_entrees (char *nomfic, int n);

void action (Biblio *b) {
    int reponse, n;
    char nomfic[20];

    switch (reponse) {
    case 7 :
        Biblio *b2 = charger_n_entrees (nomfic, n);
        break;
    }
}

int main (int argc, char** argv) {
    Biblio *b;

    action (b);
    return 0;
}
-----------------------------------------------------------------

and I obtain the following trace :

-----------------------------------------------------------------
$ splint limited_main.c
Splint 3.1.2 --- 21 Feb 2021

*** Segmentation Violation
*** Location (not trusted): limited_main.c:20:51
*** Last code point: transferChecks.c:3467
*** Previous code point: transferChecks.c:3437
*** Please report bug to submit@bugs.debian.org (via reportbug)
*** A useful bug report should include everything we need to reproduce the bug.
-----------------------------------------------------------------

This message disappear if I eliminate the switch instruction.
Hope it helps.


-- System Information:
Debian Release: trixie/sid
  APT prefers plucky-security
  APT policy: (500, 'plucky-security'), (500, 'plucky')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.14.0-33-generic (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE=fr_FR:fr_CA
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages splint depends on:
ii  libc6        2.41-6ubuntu1.2
ii  libfl2       2.6.4-8.2build1
ii  splint-data  1:3.1.2+dfsg-5

splint recommends no packages.

Versions of packages splint suggests:
ii  splint-doc-html  1:3.1.2+dfsg-5

-- no debconf information


Reply to: