cuongphphanoi / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

mg_modify_passwords_file(..) should accept a null-ptr for the password argument to delete the entry #246

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
------------------------------------------------------------------
1. Call mg_modify_passwords_file("myfile", "mydomain", "myuser", 0)

What is the expected output? What do you see instead?
------------------------------------------------------------------
- The entry (if existing) should be deleted.
- An access violation occurs on the password argument.

What version of the product are you using? On what operating system?
------------------------------------------------------------------
- OS doesn't matter
- Don't know how to find out the revision of the file (mongoose.c) -> latest

Please provide any additional information below.
------------------------------------------------------------------
Change from (mg_modify_passwords_file(..)):
// Regard empty password as no password - remove user record.
if (pass[0] == '\0') {
  pass = NULL;
}

to

// Regard empty password as no password - remove user record.
if (pass && pass[0] == '\0') {
  pass = NULL;
}

Original issue reported on code.google.com by nullable...@gmail.com on 1 Apr 2011 at 11:53

GoogleCodeExporter commented 9 years ago
mongoose.c revision: 62d9758e241a

Original comment by nullable...@gmail.com on 1 Apr 2011 at 12:29

GoogleCodeExporter commented 9 years ago
Submitted 
https://code.google.com/p/mongoose/source/detail?r=579073fb694ea150d7ac990cd3d28
012ad8a4f23, thank you.

Original comment by valenok on 22 Jun 2011 at 1:01