diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-11-10 15:05:56 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-11-10 15:09:57 +0000 |
commit | df8c6c3ad758fbcd88fbbe7fb53221a32ae3abe2 (patch) | |
tree | 35bbd4c6b8cd628ee8da82a2207f4aeb520e204e /desktop/frames.h | |
parent | 72f4c4f8b8bae950bbd0d38379e2be458bb91273 (diff) | |
download | netsurf-df8c6c3ad758fbcd88fbbe7fb53221a32ae3abe2.tar.gz netsurf-df8c6c3ad758fbcd88fbbe7fb53221a32ae3abe2.tar.bz2 |
Avoid calling calloc with 0 length data.
CERT MEM04-C suggests that zero length allocations behaviour might be
surprising so it should be avoided. This adds a check to ensure a zero
length allocation will be avoided. Additionally it returns errors to
the caller rather than warning directly (in some error paths)
Diffstat (limited to 'desktop/frames.h')
-rw-r--r-- | desktop/frames.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/desktop/frames.h b/desktop/frames.h index 15efb7d67..bca7f2e68 100644 --- a/desktop/frames.h +++ b/desktop/frames.h @@ -25,7 +25,14 @@ struct scrollbar_msg_data; -void browser_window_create_iframes(struct browser_window *bw, +/** + * Create and open iframes for a browser window. + * + * \param bw The browser window to create iframes for. + * \param iframe The iframes to create from. + * \param NSERROR_OK or error code on faliure. + */ +nserror browser_window_create_iframes(struct browser_window *bw, struct content_html_iframe *iframe); void browser_window_recalculate_iframes(struct browser_window *bw); void browser_window_create_frameset(struct browser_window *bw, |