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

Remove unused notification observer with non-existent selector #85

Merged
merged 1 commit into from Oct 22, 2012

Conversation

Projects
None yet
3 participants
@devincoughlin
Contributor

devincoughlin commented Oct 22, 2012

I'm a graduate student developing a research prototype plugin for the clang static analyzer that looks for problems with reflection in Objective-C. We ran our prototype on Vienna and found a minor but interesting (from our perspective) issue:

-[FoldersTree initialiseFoldersTree] registers itself as an observer for a bunch of notifications from the default notification center. For one of those notifications ("MA_Notify_AutoCollapseFolder") it specifies a call-back selector that doesn't exist on FoldersTree: (autoCollapseFolder:). This is kind of like a dangling pointer: if anyone were to post a "MA_Notify_AutoCollapseFolder" notification, this would throw an unrecognized selector exception.

Fortunately, it doesn't look like "MA_Notify_AutoCollapseFolder" is ever used, so it is safe to just remove the line that adds the observer. The commit in this pull request does just this.

@devincoughlin

This comment has been minimized.

Show comment
Hide comment
@devincoughlin

devincoughlin Oct 22, 2012

Owner

This commit removes a line that adds a notification center observer for the 'MA_Notify_AutoCollapseFolder' notification. The observer doesn't respond to the specified selector (autoCollapseFolder:) -- there is no instance method with that name on FoldersTree. Since no other code ever posts this notification, it is safe to remove the observer.

We found this issue with a research prototype plugin for the clang static analyzer that looks for problems with reflection.

Owner

devincoughlin commented on 0c6e5ab Oct 22, 2012

This commit removes a line that adds a notification center observer for the 'MA_Notify_AutoCollapseFolder' notification. The observer doesn't respond to the specified selector (autoCollapseFolder:) -- there is no instance method with that name on FoldersTree. Since no other code ever posts this notification, it is safe to remove the observer.

We found this issue with a research prototype plugin for the clang static analyzer that looks for problems with reflection.

mstroeck added a commit that referenced this pull request Oct 22, 2012

Merge pull request #85 from devincoughlin/master
Remove unused notification observer with non-existent selector

@mstroeck mstroeck merged commit 6fbf926 into ViennaRSS:master Oct 22, 2012

@mstroeck

This comment has been minimized.

Show comment
Hide comment
@mstroeck

mstroeck Oct 22, 2012

Contributor

Thanks, Devin! If you find any more issues, please let us know!

Contributor

mstroeck commented Oct 22, 2012

Thanks, Devin! If you find any more issues, please let us know!

@barijaona

This comment has been minimized.

Show comment
Hide comment
@barijaona

barijaona Oct 23, 2012

Member

Thanks, Devin ! Much appreciated.

Member

barijaona commented Oct 23, 2012

Thanks, Devin ! Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment