Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A Android-IMSI-Catcher-Detector
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 162
    • Issues 162
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CellularPrivacy
  • Android-IMSI-Catcher-Detector
  • Issues
  • #615
Closed
Open
Issue created Sep 19, 2015 by Administrator@rootContributor

SmsDetector doesnt check how many bytes where read from input

Created by: agilob

       while (getSmsDetectionState()) {
            try {
                int bufferlen = dis.available();

                if (bufferlen != 0) {
                    byte[] b = new byte[bufferlen];
                    dis.read(b);

                    String split[] = new String(b).split("\n");
                    checkForSilentSms(split);

                } else {
                    Thread.sleep(1000);
                }

You're reading data from dis and doing nothing with it. It looks like you should do something with the input and this introduces a potential and very difficult to reproduce bug. You cannot assume that any given stream reading call will fill the byte[] passed in to the method. Instead, you must check the value returned by the read method to see how many bytes were read.

Assignee
Assign to
Time tracking