Skip to content
Browse files

resolved conflicts for merge of 2237ca4 to jb-mr1-dev

Change-Id: I04982ff2b092274b940a621b238c2246349aa85e
  • Loading branch information...
2 parents d7f78e8 + 2237ca4 commit e92372ba9eaa04eb4ed7eb9417ee2be3515bd972 Jean-Baptiste Queru committed Aug 15, 2012
Showing with 17 additions and 5 deletions.
  1. +17 −5 sdcard/sdcard.c
View
22 sdcard/sdcard.c
@@ -1314,11 +1314,23 @@ int main(int argc, char **argv)
source_path = arg;
else if (!dest_path)
dest_path = arg;
- else if (!uid)
- uid = strtoul(arg, 0, 10);
- else if (!gid)
- gid = strtoul(arg, 0, 10);
- else {
+ else if (!uid) {
+ char* endptr = NULL;
+ errno = 0;
+ uid = strtoul(arg, &endptr, 10);
+ if (*endptr != '\0' || errno != 0) {
+ ERROR("Invalid uid");
+ return usage();
+ }
+ } else if (!gid) {
+ char* endptr = NULL;
+ errno = 0;
+ gid = strtoul(arg, &endptr, 10);
+ if (*endptr != '\0' || errno != 0) {
+ ERROR("Invalid gid");
+ return usage();
+ }
+ } else {
ERROR("too many arguments\n");
return usage();
}

0 comments on commit e92372b

Please sign in to comment.
Something went wrong with that request. Please try again.