Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couple more typos and references to None objects #27

Closed
gleeda opened this issue May 10, 2013 · 1 comment
Closed

couple more typos and references to None objects #27

gleeda opened this issue May 10, 2013 · 1 comment

Comments

@gleeda
Copy link

gleeda commented May 10, 2013

Some typos and a None object issue in cybox/objects/win_process_object.py:

diff --git a/cybox/objects/win_process_object.py b/cybox/objects/win_process_object.py
index 48aa912..45dd9f1 100644
--- a/cybox/objects/win_process_object.py
+++ b/cybox/objects/win_process_object.py
@@ -85,7 +85,7 @@ class WinProcess(Process):
 
     @staticmethod
     def from_obj(win_process_obj, win_process_cls):
-        if not win_process_dict:
+        if not win_process_obj:
             return None
         if win_process_cls == None:
             winprocess_ = Process.from_obj(win_process_obj, WinProcess())
@@ -93,10 +93,10 @@ class WinProcess(Process):
             winprocess_ = Process.from_obj(win_process_obj, win_process_cls)
 
         winprocess_.aslr_enabled = win_process_obj.get_aslr_enabled()
-        winprocess_.dep_enabled = win_process_dict.get_dep_enabled()
+        winprocess_.dep_enabled = win_process_obj.get_dep_enabled()
         winprocess_.handle_list = WinHandleList.from_obj(win_process_obj.get_Handle_List())
         winprocess_.priority = String.from_obj(win_process_obj.get_Priority())
-        winprocess_.section_list = [Memory.from_obj(x) for x in win_process_obj.get_Section_List().get_Memory_Section()]
+        if win_process_obj.get_Section_List() is not None: winprocess_.section_list = [Memory.from_obj(x) for x in win_process_obj.get_Section_List().get_Memory_Section()]
         winprocess_.security_id = String.from_obj(win_process_obj.get_Security_ID())
         winprocess_.startup_info = StartupInfo.from_obj(win_process_obj.get_Startup_Info())
         winprocess_.security_type = String.from_obj(win_process_obj.get_Security_Type())
@@ -205,4 +205,4 @@ class StartupInfo(cybox.Entity):
         startup_info_.hstdoutput = WinHandle.from_dict(startup_info_dict.get('hstdoutput'))
         startup_info_.hstderror = WinHandle.from_dict(startup_info_dict.get('hstderror'))
 
-        return startup_info_dict
\ No newline at end of file
+        return startup_info_dict

and another None object referenced here in cybox/objects/win_service_object.py:

diff --git a/cybox/objects/win_service_object.py b/cybox/objects/win_service_object.py
index ca28040..3e93400 100644
--- a/cybox/objects/win_service_object.py
+++ b/cybox/objects/win_service_object.py
@@ -111,7 +111,7 @@ class WinService(WinProcess):
         win_service_ = WinProcess.from_obj(win_service_obj, WinService())
         win_service_.service_dll_signature_exists = win_service_obj.get_service_dll_signature_exists()
         win_service_.service_dll_signature_verified = win_service_obj.get_service_dll_signature_verified()
-        win_service_.description_list = [String.from_obj(x) for x in win_service_obj.get_Description_List().get_Description()]
+        if win_service_obj.get_Description_List() is not None: win_service_.description_list = [String.from_obj(x) for x in win_service_obj.get_Description_List().get_Description()]
         win_service_.display_name = String.from_obj(win_service_obj.get_Display_Name())
         win_service_.group_name = String.from_obj(win_service_obj.get_Group_Name())
         win_service_.service_name = String.from_obj(win_service_obj.get_Service_Name())
@gtback gtback closed this as completed in 2d48225 May 13, 2013
@gtback
Copy link
Contributor

gtback commented May 13, 2013

Thanks, @gleeda . Should be fixed now. Let us know if you encounter other typos 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants