bugDazuko - Bugs: bug #9435, Possible bug with atoi function in...

 
 

bug #9435: Possible bug with atoi function in dasukoio.c

Submitted by:  Andre DUCLOS <shirka>
Submitted on:  Wed 23 Jun 2004 05:37:59 PM UTC  
 
Status: NoneAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 19 Jul 2004 09:09:23 PM UTC, comment #3:

Hi,

Thanks for the information. I will add the device number parameter in an upcoming release.

John Ogness

John Ogness <ogman>
Project Administrator
Wed 30 Jun 2004 12:42:08 PM UTC, comment #2:

Hi,

Yes, 0 is not allowed for device number. It's used for dynamic allowance device number by (devfs_)registered_chrdev.
But you're right because your module never send 0 for device number ;)

Can you add device number parameter to your module.
Look at how I made for my project : http://www.shirka.org/cgi-bin/viewcvs.cgi/recycled/kernel/Linux/2.4/ioctl.c.diff?r1=1.9&r2=1.10

Bye.

Andre DUCLOS <shirka>
Wed 30 Jun 2004 09:39:35 AM UTC, comment #1:

Hi,

This is a good point. This would be OK as long as 0 is not allowed to be a device number. ??

If "bad number" were to be given to the register function, it would not be a problem. Dazuko would simply try to attach to device major number 0. I'll need to check to see if that would cause any kind of problems.

John Ogness

John Ogness <ogman>
Project Administrator
Wed 23 Jun 2004 05:37:59 PM UTC, original submission:

Hi John,

I think that there is a minor bug in the function dazukoRegister_TS here :
temp_id->dev_major = atoi(buffer);
-> if (temp_id->dev_major < 0)

If you run this test following :
#include <stdlib.h>

int main(void)
{
int dev = -1;

dev = atoi("bad number");
printf("dev=%d\n", dev);
}

result : dev=0
atoi don't return error, but if it does not translate any digit, it returns 0.

I think then :
- if (temp_id->dev_major < 0)
+ if (temp_id->dev_major <= 0)

or use strol function.

Best regards.

Andre DUCLOS <shirka>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ogman (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 19 Mar 2011 12:45:56 PM UTCogmanAssigned toogman=>None
    Wed 30 Jun 2004 12:42:08 PM UTCshirkaCarbon-Copy-=>Added ogman
    Wed 30 Jun 2004 09:39:35 AM UTCogmanAssigned toNone=>ogman

    Back to the top


    Powered by Savane 3.1-cleanup1