Fixed a crash when trying to look up the superclass for Object

git-svn-id: https://smali.googlecode.com/svn/trunk@459 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2009-09-11 01:44:57 +00:00
parent 04473936a1
commit cc4bbc46ea

View File

@ -387,7 +387,7 @@ ClassObject *lookupSuperclass(char *classType)
if (clazz == NULL) if (clazz == NULL)
return NULL; return NULL;
return clazz->super; return clazz->super;
} }
@ -531,7 +531,7 @@ int main(int argc, char* const argv[])
memcpy(buf, command, len); memcpy(buf, command, len);
buf[len] = 0; buf[len] = 0;
//printf("%s\n", buf); printf("%s\n", buf);
char *cmd = strtok(buf, " "); char *cmd = strtok(buf, " ");
if (cmd == NULL) { if (cmd == NULL) {
@ -607,6 +607,13 @@ int main(int argc, char* const argv[])
} }
ClassObject *clazz = lookupSuperclass(classType); ClassObject *clazz = lookupSuperclass(classType);
if (clazz == NULL)
{
fprintf(clientOut, "class: \n");
fflush(clientOut);
break;
}
fprintf(clientOut, "class: %s\n", clazz->descriptor); fprintf(clientOut, "class: %s\n", clazz->descriptor);
fflush(clientOut); fflush(clientOut);
break; break;