Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8638789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:49:37+00:00 2026-06-12T10:49:37+00:00

How to perform Taint Analysis using Splint? I have installed Splint on my Ubuntu

  • 0

How to perform Taint Analysis using Splint?

I have installed Splint on my Ubuntu 12.04. Created a small test case as below:

#include<stdio.h>
#include<string.h>
int main(int argc, char *argv[]) {
    char a[10];
    strncpy(a,argv[1],10);
    printf(a);
    return 0;
}

Also created splint.xh file with the following contents:

int printf  (/*@untainted@*/ char *fmt, ...);
char *fgets (char *s, int n, FILE *stream) /*@ensures tainted s@*/ ;
char *strcat (/*@returned@*/ char *s1,  char *s2) /*@ensures s1:taintedness = s1:taintedness | s2:taintedness @*/ ;
void strncpy (/*@returned@*/ char *s1,  char *s2, size_t num)    /*@ensures s1:taintedness = s1:taintedness | s2:taintedness @*/ ;

Also created splint.mts file with the below contents:

    attribute taintedness
       context reference char *
       oneof untainted, tainted
       annotations
         tainted reference ==> tainted
         untainted reference ==> untainted
                       transfers
         tainted as untainted ==> error "Possibly tainted storage used where untainted required."
       merge
          tainted + untainted ==> tainted
       defaults
          reference ==> tainted
          literal ==> untainted
          null ==> untainted
    end

Then finally ran the splint tool with the command:

    splint -mts splint prg001.c

Where prg001.c is the sample input, “splint” refers to splint.mts and splint.xh file. All the files are in the current directory.

The output I received is:

Splint 3.1.2 — 21 Aug 2012

prg001.c: (in function main)
prg001.c:6:1: Format string parameter to printf is not a compile-time constant:
a
Format parameter is not known at compile-time. This can lead to security
vulnerabilities because the arguments cannot be type checked. (Use
-formatconst to inhibit warning)
prg001.c:3:14: Parameter argc not used
A function parameter is not used in the body of the function. If the argument
is needed for type compatibility or future plans, use /@unused@/ in the
argument declaration. (Use -paramuse to inhibit warning)

Finished checking — 2 code warnings

There is no hint of any taint analysis in the output. Can someone please help me on how to get the taint analysis done using Splint.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:49:39+00:00Added an answer on June 12, 2026 at 10:49 am

    The problem was with splint.xh file.

    I change the printf to printfxxx and it worked fine.

    This implied that standard definition was overwriting my .xh file. This solved my problem and now the splint outputs tainted variables and the flow of taint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to install STAC to perform taint analysis. I have installed the
I am writing a program that runs through pintools, to perform dynamic taint analysis
I have to perform scientific experiments using time series. I intend to use MySQL
ISQL Perform Screen: I have a date column (format=mmm-dd-yyyy) used for storing Date Manufactured.
I perform an AJAX request to a PHP script in JavaScript and by using
I perform custom drawing in my UIView subclass using: - (void)drawRect:(CGRect)rect; How can I
I perform the iFFT on a symmetric spectrum (using Python). Why is the result
I am trying to perform a Calculus Cross Product calculation using Linq and trying
I would like to perform the same operation on several arrays, something like: #include<vector>
I have to perform some inserts into an Oracle DB. I have some dates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.